{"_id":"@basestack/vercel-flags-sdk-adapter","_rev":"7-5ca17a1cc09fe3a2e4e22ea61b78535e","name":"@basestack/vercel-flags-sdk-adapter","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@basestack/vercel-flags-sdk-adapter","version":"1.0.0","keywords":["vercel","flags","feature-flags","basestack","adapter"],"license":"MIT","_id":"@basestack/vercel-flags-sdk-adapter@1.0.0","maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"homepage":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter#readme","bugs":{"url":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter/issues"},"dist":{"shasum":"7e68164c279233eb6bde34c917643f9cded820ee","tarball":"https://registry.npmjs.org/@basestack/vercel-flags-sdk-adapter/-/vercel-flags-sdk-adapter-1.0.0.tgz","fileCount":5,"integrity":"sha512-xwAjO/OVT7GX0tA6qB0mzDJzenzuGVfvlAPsiJNm9NnR9Fax6IN3+KlZ5kxUWrRNXkHOxjxH0/uRYSNmL8+ERQ==","signatures":[{"sig":"MEYCIQDlXX/10FpTmLYQOsK0P8ryq61qMKu4htD6LmenlaxcggIhAL1LTvt4uS1tCG3x4mEiEAnOllBHAxUuGU5lN7cJVkio","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14839},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"b91d35d106fd0464e5e3a0c88b6b78371212953d","scripts":{"dev":"tsdown --watch","lint":"bunx biome lint .","test":"vitest run","build":"tsdown","check":"bunx biome check --write .","clean":"node_modules && rm -rf dist","format":"bunx biome format --write .","test:watch":"vitest watch","update:deps":"bun update -i","prepublishOnly":"bun run lint && bun run test && bun run build"},"_npmUser":{"name":"basestack","email":"vitor.amaral@basestack.co"},"repository":{"url":"git+https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter.git","type":"git"},"_npmVersion":"10.9.0","description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","dependencies":{"flags":"^4.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.2","devDependencies":{"tsdown":"^0.16.6","vitest":"^4.0.12","@types/bun":"^1.3.2","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.6"},"_npmOperationalInternal":{"tmp":"tmp/vercel-flags-sdk-adapter_1.0.0_1763642703020_0.06080828398064875","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@basestack/vercel-flags-sdk-adapter","version":"1.0.1","keywords":["vercel","flags","feature-flags","basestack","adapter"],"license":"MIT","_id":"@basestack/vercel-flags-sdk-adapter@1.0.1","maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"homepage":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter#readme","bugs":{"url":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter/issues"},"dist":{"shasum":"de168af266a4a6c3a961252ec35c9cadcda4765f","tarball":"https://registry.npmjs.org/@basestack/vercel-flags-sdk-adapter/-/vercel-flags-sdk-adapter-1.0.1.tgz","fileCount":5,"integrity":"sha512-/zbNKG19xm91oaERoArF/DtC4vjr4T1Ra2P2SmXVzxbFwEaX5rDFGFANyUQBhN/YHn+blichPP8LTRyz2CtdNA==","signatures":[{"sig":"MEQCID7XEjwnohYGbM2pqwhvw7JjDsUrC8f1MxVFI1/oy7+OAiA2UmnBneSETSuKUc9vBY7KttQLy6kXX4b070GfXEVPrw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14839},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"629aee8b50fc0d2e650d938617d8815c3f9851c0","scripts":{"dev":"tsdown --watch","lint":"bunx biome lint .","test":"vitest run","build":"tsdown","check":"bunx biome check --write .","clean":"node_modules && rm -rf dist","format":"bunx biome format --write .","test:watch":"vitest watch","update:deps":"bun update -i","prepublishOnly":"bun run lint && bun run test && bun run build"},"_npmUser":{"name":"basestack","email":"vitor.amaral@basestack.co"},"repository":{"url":"git+https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter.git","type":"git"},"_npmVersion":"10.9.0","description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","dependencies":{"flags":"^4.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.4","devDependencies":{"tsdown":"^0.17.2","vitest":"^4.0.15","@types/bun":"^1.3.4","typescript":"^5.9.3","@types/node":"^24.10.2","@biomejs/biome":"^2.3.8"},"_npmOperationalInternal":{"tmp":"tmp/vercel-flags-sdk-adapter_1.0.1_1765298582878_0.9278860656091612","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@basestack/vercel-flags-sdk-adapter","version":"1.0.2","keywords":["vercel","flags","feature-flags","basestack","adapter"],"license":"MIT","_id":"@basestack/vercel-flags-sdk-adapter@1.0.2","maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"homepage":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter#readme","bugs":{"url":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter/issues"},"dist":{"shasum":"318636b51624618e7aa277aa5d3f92eb7312c8c7","tarball":"https://registry.npmjs.org/@basestack/vercel-flags-sdk-adapter/-/vercel-flags-sdk-adapter-1.0.2.tgz","fileCount":5,"integrity":"sha512-7D72APBoS8hedKy0Q4Z7mCrlRlK9v86Av+Yskqk7nOBrdPfwSu1Tt9ujQSPAwuI5MumSJrev+lMp9Hap18h6fQ==","signatures":[{"sig":"MEYCIQD6PUfsCX9+SVF86OxgR0sVpaqwvwCeI2DQ1d0d9iAqFgIhAL3X0Hx3omCfLbF1cbV6Rw9TuOo9MufkhFEAdyjYIx0R","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14999},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"758e8a0f3cc667ebfd21b5e1d1dc84c1851182ab","scripts":{"ci":"bun run lint:ci && bun run typecheck && bun run test && bun run build","dev":"tsdown --watch","lint":"bunx biome lint .","test":"vitest run","build":"tsdown","check":"bunx biome check --write .","clean":"node_modules && rm -rf dist","format":"bunx biome format --write .","lint:ci":"bunx biome check .","typecheck":"bunx tsc --noEmit","test:watch":"vitest watch","update:deps":"bun update -i","prepublishOnly":"bun run lint && bun run test && bun run build"},"_npmUser":{"name":"basestack","email":"vitor.amaral@basestack.co"},"repository":{"url":"git+https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter.git","type":"git"},"_npmVersion":"11.9.0","description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","dependencies":{"flags":"^4.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.12","devDependencies":{"tsdown":"^0.21.7","vitest":"^4.1.4","@types/bun":"^1.3.12","typescript":"^6.0.2","@types/node":"^25.6.0","@biomejs/biome":"^2.4.11"},"_npmOperationalInternal":{"tmp":"tmp/vercel-flags-sdk-adapter_1.0.2_1775930405841_0.5456593641751446","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@basestack/vercel-flags-sdk-adapter","version":"1.0.3","keywords":["vercel","flags","feature-flags","basestack","adapter"],"license":"MIT","_id":"@basestack/vercel-flags-sdk-adapter@1.0.3","maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"homepage":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter#readme","bugs":{"url":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter/issues"},"dist":{"shasum":"2952178e1e91bd1b7a4cc4b707d1c53b12ed2029","tarball":"https://registry.npmjs.org/@basestack/vercel-flags-sdk-adapter/-/vercel-flags-sdk-adapter-1.0.3.tgz","fileCount":5,"integrity":"sha512-KYl2JW4dccHyI3/FnVKlytKhsM/RbESL601hFwqQhnJwHR46AL0ZbZDvVX+zU95hnRJj9vk0vsS+2JpS6yzBJQ==","signatures":[{"sig":"MEUCIH0auqOi39L+XmHm17rMIfFNx9H8b/uAmH7oUQBPnwwhAiEA1eU/YmL0ZISVqnTKii8d1Z2d2ZkRBrodFsZQdwkmrjY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15023},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"1e4615d5009a0fcea76b4fb0cc2b3273e52fe99f","scripts":{"ci":"bun run lint:ci && bun run typecheck && bun run test && bun run build","dev":"tsdown --watch","lint":"bunx biome lint .","test":"vitest run","build":"tsdown","check":"bunx biome check --write .","clean":"node_modules && rm -rf dist","format":"bunx biome format --write .","lint:ci":"bunx biome check .","typecheck":"bunx tsc --noEmit","test:watch":"vitest watch","update:deps":"bun update -i","prepublishOnly":"bun run lint && bun run test && bun run build"},"_npmUser":{"name":"basestack","email":"vitor.amaral@basestack.co"},"repository":{"url":"git+https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter.git","type":"git"},"_npmVersion":"11.9.0","description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.12","devDependencies":{"flags":"^4.0.6","tsdown":"^0.21.7","vitest":"^4.1.4","@types/bun":"^1.3.12","typescript":"^6.0.2","@types/node":"^25.6.0","@biomejs/biome":"^2.4.11"},"peerDependencies":{"flags":"^4.0.6"},"_npmOperationalInternal":{"tmp":"tmp/vercel-flags-sdk-adapter_1.0.3_1775932145913_0.5831086412884947","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@basestack/vercel-flags-sdk-adapter","version":"1.0.4","keywords":["vercel","flags","feature-flags","basestack","adapter"],"license":"MIT","_id":"@basestack/vercel-flags-sdk-adapter@1.0.4","maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"homepage":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter#readme","bugs":{"url":"https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter/issues"},"dist":{"shasum":"a1529320761ad7b734061a0dfb76275d2c6f9d6c","tarball":"https://registry.npmjs.org/@basestack/vercel-flags-sdk-adapter/-/vercel-flags-sdk-adapter-1.0.4.tgz","fileCount":5,"integrity":"sha512-U8iz9DnDwi3oTdqF75lfjm+1Y7EEczCOXxYO5cYbPjxzJPMAalDFuGSoVQ1Nu5S2zvYUHbCIsDx0qYuIwsrEhg==","signatures":[{"sig":"MEUCIBIK2khPsDlLudMp3HOcxBOCrvpJgz/Rz1AF6hYtxYJ+AiEAhc91PAWvpLP59wcp6rRU4CoSok4LvCOM5zuniNdljjg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15024},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"97472dab4492cf20d2fc52fa78ea7a9da9430bf6","scripts":{"ci":"bun run lint:ci && bun run typecheck && bun run test && bun run build","dev":"tsdown --watch","lint":"bunx biome lint .","test":"vitest run","build":"tsdown","check":"bunx biome check --write .","clean":"node_modules && rm -rf dist","format":"bunx biome format --write .","lint:ci":"bunx biome check .","typecheck":"bunx tsc --noEmit","test:watch":"vitest watch","update:deps":"bun update -i","prepublishOnly":"bun run lint && bun run test && bun run build"},"_npmUser":{"name":"basestack","email":"vitor.amaral@basestack.co"},"repository":{"url":"git+https://github.com/basestack-co/basestack-vercel-flags-sdk-adapter.git","type":"git"},"_npmVersion":"11.9.0","description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.13","devDependencies":{"flags":"^4.0.6","tsdown":"^0.21.10","vitest":"^4.1.5","@types/bun":"^1.3.13","typescript":"^6.0.3","@types/node":"^25.6.2","@biomejs/biome":"^2.4.14"},"peerDependencies":{"flags":"^4.0.6"},"_npmOperationalInternal":{"tmp":"tmp/vercel-flags-sdk-adapter_1.0.4_1778409000864_0.0356281224040651","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@basestack/vercel-flags-sdk-adapter","version":"1.0.5","keywords":["vercel","flags","feature-flags","basestack","adapter"],"license":"MIT","_id":"@basestack/vercel-flags-sdk-adapter@1.0.5","maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"homepage":"https://basestack.co/product/feature-flags","bugs":{"email":"support@basestack.co"},"dist":{"shasum":"b63e46fffac57e44d5ec6a4123c5b717962a0164","tarball":"https://registry.npmjs.org/@basestack/vercel-flags-sdk-adapter/-/vercel-flags-sdk-adapter-1.0.5.tgz","fileCount":7,"integrity":"sha512-5AgPBdic42eVrslkSfDZ9A+fM5CfXsZ/b0qa9AjbavJjvmtNhc6xzdR9Z7uRtNohiL2eYYH5EFB22X+urQamnw==","signatures":[{"sig":"MEUCIHv8vsCxkoIRQwTtFnuRAIp09fzs65fxkz2cmPVD0+L3AiEA8X7le889F/U+vjggw4ShC7ZJCiRzRjyQtknOCrAn5JA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32432},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"36f72ebe6bf1f75fa8e81e1ec86131ccb4b240da","scripts":{"dev":"NODE_ENV=development tsdown --watch","lint":"biome check src tests","test":"vitest run","build":"NODE_ENV=production tsdown","clean":"rm -rf .turbo && rm -rf node_modules && rm -rf dist","lint:fix":"biome check src tests --write","typecheck":"tsc --noEmit","test:watch":"vitest watch","test:update":"vitest run --update","update:deps":"bun update -i","test:coverage":"vitest run --coverage","prepublishOnly":"bun run lint && bun run typecheck && bun run test && bun run build"},"_npmUser":{"name":"basestack","email":"vitor.amaral@basestack.co"},"repository":{"url":"git+https://github.com/basestack-co/basestack.git","type":"git"},"_npmVersion":"11.9.0","description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"flags":"^4.2.0","tsdown":"catalog:","@types/bun":"catalog:","typescript":"catalog:","@types/node":"catalog:","@basestack/tsconfig":"workspace:*","@edge-runtime/cookies":"^6.0.0"},"peerDependencies":{"flags":"^4.2.0"},"_npmOperationalInternal":{"tmp":"tmp/vercel-flags-sdk-adapter_1.0.5_1781807526720_0.4201620339359553","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@basestack/vercel-flags-sdk-adapter","version":"1.0.6","description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","license":"MIT","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"NODE_ENV=production tsdown","dev":"NODE_ENV=development tsdown --watch","clean":"rm -rf .turbo && rm -rf node_modules && rm -rf dist","update:deps":"bun update -i","lint":"biome check src tests","lint:fix":"biome check src tests --write","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest watch","test:coverage":"vitest run --coverage","test:update":"vitest run --update","prepublishOnly":"bun run lint && bun run typecheck && bun run test && bun run build"},"keywords":["vercel","flags","feature-flags","basestack","adapter"],"repository":{"type":"git","url":"git+https://github.com/basestack-co/basestack.git"},"bugs":{"email":"support@basestack.co"},"homepage":"https://basestack.co/product/feature-flags","engines":{"node":">=18.17.0"},"peerDependencies":{"flags":"^4.3.0"},"devDependencies":{"@basestack/tsconfig":"workspace:*","@edge-runtime/cookies":"^6.0.0","@types/bun":"catalog:","@types/node":"catalog:","flags":"^4.3.0","tsdown":"catalog:","typescript":"catalog:"},"publishConfig":{"access":"public"},"gitHead":"588cb821c74e4a0d2625fd555179e0a75129dc08","_id":"@basestack/vercel-flags-sdk-adapter@1.0.6","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-UFEjcxxYRP+7W3y46CzhqNh/rWzyyyk3qPZNXtjpM9lwZerAuQk6sVlFa0swSmnR2AfToJC6Va6KcD9d5amIEg==","shasum":"6bdfeb470283eaa3e12a9cc831ad51ffd55339f8","tarball":"https://registry.npmjs.org/@basestack/vercel-flags-sdk-adapter/-/vercel-flags-sdk-adapter-1.0.6.tgz","fileCount":7,"unpackedSize":31860,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDpg9y0kgxK963xBV5cRJULq4F8y7eRTekj6K7zMhih1AIhAK7Wot7/VSk8Jt1tZV1RR8NOPQ9IYeaXXLRzprbbMF/Q"}]},"_npmUser":{"name":"basestack","email":"vitor.amaral@basestack.co"},"directories":{},"maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vercel-flags-sdk-adapter_1.0.6_1786541166975_0.8559793986870219"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-20T12:45:02.893Z","modified":"2026-08-12T13:26:07.282Z","1.0.0":"2025-11-20T12:45:03.219Z","1.0.1":"2025-12-09T16:43:03.015Z","1.0.2":"2026-04-11T18:00:05.976Z","1.0.3":"2026-04-11T18:29:06.044Z","1.0.4":"2026-05-10T10:30:01.002Z","1.0.5":"2026-06-18T18:32:06.857Z","1.0.6":"2026-08-12T13:26:07.116Z"},"bugs":{"email":"support@basestack.co"},"license":"MIT","homepage":"https://basestack.co/product/feature-flags","keywords":["vercel","flags","feature-flags","basestack","adapter"],"repository":{"type":"git","url":"git+https://github.com/basestack-co/basestack.git"},"description":"Vercel Flags adapter backed by the Basestack Feature Flags API.","maintainers":[{"name":"basestack","email":"vitor.amaral@basestack.co"}],"readme":"# Basestack adapter for the Vercel Flags SDK\n\nA tiny helper that connects [Basestack's Feature Flags API](https://flags-api.basestack.co/v1) to the\n[Vercel Flags SDK](https://flags-sdk.com). It exposes a ready-to-use adapter so you can keep using the\nSDK primitives you already know while letting Basestack act as your remote flag source.\n\n## Features\n\n- ✅ Ships as an [adapter](https://flags-sdk.com/docs/adapters) the SDK can plug into immediately\n- 🚀 Bundled with [tsdown](https://tsdown.dev) for small ESM/CJS artifacts and `.d.ts` files\n- 🧪 Tested with Vitest and formatted/linted with Biome\n- ⚙️ Supports payload or boolean style flags with customizable value resolvers\n- 🧠 Uses a tiny cache and optional warm-up to avoid calling your API more than needed\n\n## Installation\n\n```bash\nbun add flags @basestack/vercel-flags-sdk-adapter\n# or npm/pnpm/yarn if you prefer\n```\n\n`flags` is a peer dependency, so your app must install both packages.\n\n## Usage\n\nCreate a single adapter instance and reuse it across your `flag()` definitions. Provide your Basestack\nproject/environment keys and (optionally) a `resolveValue` callback to coerce the API payload to the\nshape your application expects.\n\n```ts\n// app/flags.ts\nimport { flag } from \"flags/next\";\nimport { createBasestackAdapter } from \"@basestack/vercel-flags-sdk-adapter\";\n\nconst basestack = createBasestackAdapter<boolean>({\n  projectKey: process.env.BASESTACK_PROJECT_KEY!,\n  environmentKey: process.env.BASESTACK_ENVIRONMENT_KEY!,\n  resolveValue: (flag) => flag.enabled\n});\n\nexport const onboardingFlowFlag = flag<boolean>({\n  key: \"onboarding-flow\",\n  adapter: basestack,\n  defaultValue: false,\n  description: \"Enables the streamlined onboarding journey\"\n});\n```\n\nWhenever the SDK evaluates `onboardingFlowFlag()` it will call your Basestack API at\n`https://flags-api.basestack.co/v1/flags/{slug}`. Successful responses are cached for 30 seconds by default,\nso subsequent evaluations during a single request won't issue extra network calls.\n\n### Adapter options\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `projectKey` | `string` | — | Required. Basestack project key sent via the `x-project-key` header. |\n| `environmentKey` | `string` | — | Required. Basestack environment key sent via the `x-environment-key` header. |\n| `endpoint` | `string` | `https://flags-api.basestack.co/v1` | Override when pointing to a different deployment (provide the API base; the client appends `/flags` paths automatically). |\n| `fetch` | `typeof fetch` | `globalThis.fetch` | Provide a custom fetch implementation (e.g. undici) when running outside Node 18+/Bun. |\n| `resolveValue` | `(flag) => Value` | `flag.payload ?? flag.enabled` | Maps the raw Basestack flag document to the value returned by the SDK. |\n| `cacheTtlMs` | `number` | `30_000` | Amount of time (ms) a resolved flag should be cached in memory. Set to `0` to disable. |\n| `requestTimeoutMs` | `number` | — | Aborts fetch calls after the configured timeout. |\n| `headers` | `HeadersInit` | — | Additional headers merged into every request. |\n| `prefetch` | `'none' | 'all'` | `'none'` | Prefetch every flag during the adapter's `initialize` hook. |\n| `onError` | `(error) => void` | — | Observe API/transform errors (the adapter still resolves `undefined` so the SDK can fall back to defaults). |\n| `identify` | `Identify<Entities>` | — | Pass-through to the SDK when you also need custom entity detection logic. |\n\n### Working with payloads\n\nBasestack flags can store arbitrary JSON payloads. You can keep them as-is, transform them, or only look\nat the `enabled` state depending on the needs of each flag.\n\n```ts\nconst productCopyAdapter = createBasestackAdapter<string>({\n  projectKey,\n  environmentKey,\n  resolveValue: (flag) => String(flag.payload ?? \"\")\n});\n\nexport const productCopy = flag<string>({\n  key: \"product-copy\",\n  adapter: productCopyAdapter,\n  defaultValue: \"\"\n});\n```\n\n### Using the client directly\n\nIf you ever need raw access to the API (for example to seed server components) you can import the\n`BasestackFlagsClient` directly:\n\n```ts\nimport { BasestackFlagsClient } from \"@basestack/vercel-flags-sdk-adapter\";\n\nconst client = new BasestackFlagsClient({ projectKey, environmentKey });\nconst flags = await client.listFlags();\n```\n\nThe client uses the same headers/caching behavior as the adapter and is fully typed.\n\n<!--\n\n## Development\n\nThis repository is set up with Bun `1.3.13` as the package manager/runtime and comes with everything\nneeded to ship a polished package.\n\n```bash\nbun install        # install dependencies\nbun run lint       # run Biome linting\nbun run format     # format the codebase\nbun run test       # execute the Vitest suite\nbun run build      # build the distributable with tsdown\n```\n\nThe output of `bun run build` lives in `dist/` and includes the ESM bundle and `d.ts`\nartifacts ready to be published to npm under the MIT license.\n\n## Framework examples\n\nNeed a starting point? Check the framework-specific snippets under [`examples/`](examples):\n\n- `next-app-router` – evaluates flags inside React Server Components\n- `next-pages-router` – passes the classic `req` object into the SDK\n-->\n\n> This SDK is distributed under the MIT License. Development is maintained in a private monorepo, and releases are published to npm as the official distribution.\n>\n> For bug reports, support requests, or security concerns, please contact support@basestack.co.\n","readmeFilename":"README.md"}