Minimal Auth0 client credentials token acquisition with Redis caching (v0.1.0). Solves M2M token quota limits by caching tokens in Redis with automatic TTL management. Integrates with the official Auth0 SDK (v5+) and ioredis (v5+). Designed for Node.js >=18. Provides a simple `createTokenClient` factory function returning an async `getAccessToken()` method. Cache key includes `clientId` and `audience`; supports configurable prefix and TTL buffer. Ships TypeScript definitions. Low dependency footprint but requires peer dependencies `auth0` and `ioredis`. Not battle-tested; experimental release.
npm install auth0-cc-token-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a token client with Auth0 config and Redis cache, then retrieving an access token.
Run `npm install auth0 ioredis` alongside this package.
Upgrade Node.js to version 18 or later.
Ensure your project has `"auth0": "^5.0.0"` in dependencies.
Ensure your project has `"ioredis": "^5.0.0"` in dependencies.
Use the same `clientId` and `audience` for all calls to avoid cache misses.
Run `npm install auth0`
Ensure you pass an instance of `ioredis` (e.g., `new Redis()`) to the `cache.redis` option.
Provide `domain` in the `auth0` config object as a non-empty string.
Use `import { createTokenClient } from 'auth0-cc-token-cache'`.