{"id":44336,"library":"auth0-cc-token-cache","title":"auth0-cc-token-cache","description":"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.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/MrVidmantas/auth0-cc-client-wrapper","tags":["javascript","auth0","oauth2","client-credentials","token","cache","redis","m2m","machine-to-machine","typescript"],"install":[{"cmd":"npm install auth0-cc-token-cache","lang":"bash","label":"npm"},{"cmd":"yarn add auth0-cc-token-cache","lang":"bash","label":"yarn"},{"cmd":"pnpm add auth0-cc-token-cache","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: official Auth0 SDK used for client credentials grant token acquisition","package":"auth0","optional":false},{"reason":"Peer dependency: Redis client for token caching","package":"ioredis","optional":false}],"imports":[{"note":"Named export, not default. TypeScript ships types.","wrong":"import createTokenClient from 'auth0-cc-token-cache'","symbol":"createTokenClient","correct":"import { createTokenClient } from 'auth0-cc-token-cache'"},{"note":"TypeScript type import only; not a runtime value.","wrong":"import { Auth0CCTokenClient } from 'auth0-cc-token-cache'","symbol":"Auth0CCTokenClient","correct":"import type { Auth0CCTokenClient } from 'auth0-cc-token-cache'"},{"note":"Config type is exported for type usage only.","wrong":"const { TokenClientConfig } = require('auth0-cc-token-cache')","symbol":"TokenClientConfig","correct":"import type { TokenClientConfig } from 'auth0-cc-token-cache'"}],"quickstart":{"code":"import { createTokenClient } from 'auth0-cc-token-cache';\nimport Redis from 'ioredis';\n\nconst redis = new Redis(process.env.REDIS_URL ?? 'redis://localhost:6379');\n\nconst tokenClient = createTokenClient({\n  auth0: {\n    domain: process.env.AUTH0_DOMAIN ?? 'your-tenant.auth0.com',\n    clientId: process.env.AUTH0_CLIENT_ID ?? '',\n    clientSecret: process.env.AUTH0_CLIENT_SECRET ?? '',\n  },\n  audience: process.env.AUTH0_AUDIENCE ?? 'https://your-api.example.com',\n  cache: {\n    redis,\n    keyPrefix: 'my-app',\n    ttlBuffer: 60,\n  },\n});\n\nconst token = await tokenClient.getAccessToken();\nconsole.log(token);","lang":"typescript","description":"Demonstrates creating a token client with Auth0 config and Redis cache, then retrieving an access token."},"warnings":[{"fix":"Run `npm install auth0 ioredis` alongside this package.","message":"Requires peer dependencies `auth0` and `ioredis` to be installed separately.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade Node.js to version 18 or later.","message":"Node.js >=18 required; older versions not supported.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure your project has `\"auth0\": \"^5.0.0\"` in dependencies.","message":"The `auth0` peer dependency must be version 5 or higher.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure your project has `\"ioredis\": \"^5.0.0\"` in dependencies.","message":"The `ioredis` peer dependency must be version 5 or higher.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use the same `clientId` and `audience` for all calls to avoid cache misses.","message":"Cache key includes `clientId` and `audience`; ensure these are consistent across requests.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'18':43 'acquisit':11 'async':52 'audienc':60 'auth0':2,7,34,77,87 'auth0-cc-token-cache':1 'automat':27 'battl':82 'battle-test':81 'buffer':66 'cach':5,14,22,55,93 'cc':3 'client':8,90 'client-credenti':89 'clientid':58 'configur':62 'createtokencli':47 'credenti':9,91 'definit':69 'depend':71,76 'design':40 'experiment':84 'factori':48 'footprint':72 'function':49 'getaccesstoken':53 'includ':57 'integr':30 'ioredi':38,79 'javascript':86 'key':56 'limit':20 'low':70 'm2m':17,95 'machin':97,99 'machine-to-machin':96 'manag':29 'method':54 'minim':6 'node.js':42 'oauth2':88 'offici':33 'peer':75 'prefix':63 'provid':44 'quota':19 'redi':13,25,94 'releas':85 'requir':74 'return':50 'sdk':35 'ship':67 'simpl':46 'solv':16 'support':61 'test':83 'token':4,10,18,23,92 'ttl':28,65 'typescript':68,100 'v0.1.0':15 'v5':36,39","created_at":"2026-06-07T12:49:38.779074+00:00","updated_at":"2026-06-07T12:49:38.779074+00:00","problems":[{"fix":"Run `npm install auth0`","cause":"Missing peer dependency `auth0`.","error":"Cannot find module 'auth0'"},{"fix":"Ensure you pass an instance of `ioredis` (e.g., `new Redis()`) to the `cache.redis` option.","cause":"Passed invalid Redis instance (not an ioredis client).","error":"TypeError: redis.get is not a function"},{"fix":"Provide `domain` in the `auth0` config object as a non-empty string.","cause":"Missing `auth0.domain` in config.","error":"Error: Auth0 domain is required"},{"fix":"Use `import { createTokenClient } from 'auth0-cc-token-cache'`.","cause":"Default import used instead of named import.","error":"TypeError: createTokenClient is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/MrVidmantas/auth0-cc-client-wrapper#readme","github":"https://github.com/MrVidmantas/auth0-cc-client-wrapper","docs":null,"changelog":null,"pypi":null,"npm":"auth0-cc-token-cache","openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}