{"_id":"@blazing-customs/ppx-vercel-ai","_rev":"6-eef048ee3c6ec73fc2a25f579017a917","name":"@blazing-customs/ppx-vercel-ai","dist-tags":{"latest":"0.1.0-alpha.4"},"versions":{"0.1.0-alpha.0":{"name":"@blazing-customs/ppx-vercel-ai","version":"0.1.0-alpha.0","license":"Apache-2.0","_id":"@blazing-customs/ppx-vercel-ai@0.1.0-alpha.0","maintainers":[{"name":"coolblaze03","email":"chabli.boler@gmail.com"}],"homepage":"https://blazing-customs.github.io/ppx-spec/","bugs":{"url":"https://github.com/Blazing-Customs/ppx-sdks/issues"},"dist":{"shasum":"680d77658bac88b4ed49dfdb0a0908f95f532b91","tarball":"https://registry.npmjs.org/@blazing-customs/ppx-vercel-ai/-/ppx-vercel-ai-0.1.0-alpha.0.tgz","fileCount":7,"integrity":"sha512-QDh4U3UKb1PdkAiiowsTJk0B1ejM+7khwVaycAets/4o/0Awuth2NPiesNLQHxzPLDbC0z+3WOplq3gnYM0eJQ==","signatures":[{"sig":"MEQCIHTMZrn0apYpnTO/YcwHZzf8Q66cFJfek0D/QZbGNJ/HAiAMdkQgs5HKAq7Rq9DihjWjLgzS/zB4hHwhY9Z3NWZrFg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22562},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"}},"gitHead":"a4e9193d1de69d638b74fa52f8727ab9f03dcabc","scripts":{"lint":"tsc --noEmit","build":"tsc"},"_npmUser":{"name":"coolblaze03","email":"chabli.boler@gmail.com"},"repository":{"url":"git+https://github.com/Blazing-Customs/ppx-sdks.git","type":"git","directory":"typescript/vercel-ai"},"_npmVersion":"10.8.2","description":"Vercel AI SDK integration for PPX — tool helper + consent-flow React hook.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":"^18.3.1","typescript":"^5.5.0","@types/react":"^18.3.3","@blazing-customs/ppx-client":"*"},"peerDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":">=18.0.0","@blazing-customs/ppx-client":"^0.1.0-alpha.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ppx-vercel-ai_0.1.0-alpha.0_1785446311099_0.4750928664427869","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Speaks the withdrawn v1 consent flow; providers now reject it. Use 0.1.0-alpha.4."},"0.1.0-alpha.1":{"name":"@blazing-customs/ppx-vercel-ai","version":"0.1.0-alpha.1","license":"Apache-2.0","_id":"@blazing-customs/ppx-vercel-ai@0.1.0-alpha.1","maintainers":[{"name":"coolblaze03","email":"chabli.boler@gmail.com"}],"homepage":"https://blazing-customs.github.io/ppx-spec/","bugs":{"url":"https://github.com/Blazing-Customs/ppx-sdks/issues"},"dist":{"shasum":"306ec223c4f3cb69a63d11f43607a0e04baeb1ed","tarball":"https://registry.npmjs.org/@blazing-customs/ppx-vercel-ai/-/ppx-vercel-ai-0.1.0-alpha.1.tgz","fileCount":7,"integrity":"sha512-Va52L13cC8+2XJ9U5Dv3OGXThw/9O7qFUraM6mN0+SrDTyT9hkVrogb5L+3HcD4E5eUoKTTUYS9xr+uvBwTQmQ==","signatures":[{"sig":"MEUCIH4mYEAEwYxWGVHvuqO99JkT6ilF5j0wzzaTkCClcW/DAiEAiHkaoWWEQgBgxF+1ND2a16aEBSl2sZ3KTo6LGrGkXnI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22348},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"}},"gitHead":"a4e9193d1de69d638b74fa52f8727ab9f03dcabc","scripts":{"lint":"tsc --noEmit","build":"tsc"},"_npmUser":{"name":"coolblaze03","email":"chabli.boler@gmail.com"},"deprecated":"Speaks the withdrawn v1 consent flow; providers now reject it. Use 0.1.0-alpha.4.","repository":{"url":"git+https://github.com/Blazing-Customs/ppx-sdks.git","type":"git","directory":"typescript/vercel-ai"},"_npmVersion":"10.8.2","description":"Vercel AI SDK integration for PPX — tool helper + consent-flow React hook.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":"^18.3.1","typescript":"^5.5.0","@types/react":"^18.3.3","@blazing-customs/ppx-client":"*"},"peerDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":">=18.0.0","@blazing-customs/ppx-client":"^0.1.0-alpha.1"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ppx-vercel-ai_0.1.0-alpha.1_1785446424156_0.09548757335734992","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.2":{"name":"@blazing-customs/ppx-vercel-ai","version":"0.1.0-alpha.2","license":"Apache-2.0","_id":"@blazing-customs/ppx-vercel-ai@0.1.0-alpha.2","maintainers":[{"name":"coolblaze03","email":"chabli.boler@gmail.com"}],"homepage":"https://blazing-customs.github.io/ppx-spec/","dist":{"shasum":"aeae9e0d72d15ac4963fcd5b21d37c61a25e6d67","tarball":"https://registry.npmjs.org/@blazing-customs/ppx-vercel-ai/-/ppx-vercel-ai-0.1.0-alpha.2.tgz","fileCount":7,"integrity":"sha512-9UAdROMs+8Z+zh38/VPgQQD9PtvZZtBluVXrRWpbahA1V5OtjakHg7kDU2RN48BAFBLd3CsStkT3/osmClDgFw==","signatures":[{"sig":"MEQCIAt/PGA2inYGJmz/CzYXl0mMFn67qDg8WaXJ9kebtF8gAiAVTqfl5x9XqDxF50t/SgY15hsI877fcte7LOdKEnM8UA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24137},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"}},"gitHead":"565838313702aaf09804746c4df74b85e213a126","scripts":{"lint":"tsc --noEmit","build":"tsc"},"_npmUser":{"name":"coolblaze03","email":"chabli.boler@gmail.com"},"_npmVersion":"10.8.2","description":"Vercel AI SDK integration for PPX — tool helper + consent-flow React hook.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":"^18.3.1","typescript":"^5.5.0","@types/react":"^18.3.3","@blazing-customs/ppx-client":"*"},"peerDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":">=18.0.0","@blazing-customs/ppx-client":"^0.1.0-alpha.2"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ppx-vercel-ai_0.1.0-alpha.2_1785892992207_0.6223541934359673","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.4":{"name":"@blazing-customs/ppx-vercel-ai","version":"0.1.0-alpha.4","license":"Apache-2.0","_id":"@blazing-customs/ppx-vercel-ai@0.1.0-alpha.4","maintainers":[{"name":"coolblaze03","email":"chabli.boler@gmail.com"}],"homepage":"https://blazing-customs.github.io/ppx-spec/","dist":{"shasum":"2b5785f5d4115bf221b31e0f93cb89bddd82183c","tarball":"https://registry.npmjs.org/@blazing-customs/ppx-vercel-ai/-/ppx-vercel-ai-0.1.0-alpha.4.tgz","fileCount":7,"integrity":"sha512-igfdE8+h3v7F9sMQzcO031r3ydqm4MYcSyTwo/azsT7/DKlPX3zikCRFhwEAWobJIxBbkz0rOxd/ZTyzX4HiLA==","signatures":[{"sig":"MEQCIHl8Mq4xvrBBbb4Llxmcci+ZdYyAg+kR3tO7PMlmMCSLAiBK8XPWx87C8m5yG0paUJLuAhlz3/ds0zGZpQs1wdZT7Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24137},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"}},"gitHead":"1792559ce7c3fbedef14f83fde8c83a1804b26e2","scripts":{"lint":"tsc --noEmit","build":"tsc"},"_npmUser":{"name":"coolblaze03","email":"chabli.boler@gmail.com"},"_npmVersion":"10.8.2","description":"Vercel AI SDK integration for PPX — tool helper + consent-flow React hook.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":"^18.3.1","typescript":"^5.5.0","@types/react":"^18.3.3","@blazing-customs/ppx-client":"*"},"peerDependencies":{"ai":"^5.0.0","zod":"^3.23.0","react":">=18.0.0","@blazing-customs/ppx-client":"^0.1.0-alpha.4"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ppx-vercel-ai_0.1.0-alpha.4_1785896835296_0.3018316955877869","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-07-30T21:18:30.902Z","modified":"2026-08-05T02:27:54.586Z","0.1.0-alpha.0":"2026-07-30T21:18:31.263Z","0.1.0-alpha.1":"2026-07-30T21:20:24.343Z","0.1.0-alpha.2":"2026-08-05T01:23:12.356Z","0.1.0-alpha.4":"2026-08-05T02:27:15.460Z"},"license":"Apache-2.0","homepage":"https://blazing-customs.github.io/ppx-spec/","description":"Vercel AI SDK integration for PPX — tool helper + consent-flow React hook.","maintainers":[{"name":"coolblaze03","email":"chabli.boler@gmail.com"}],"readme":"# @blazing-customs/ppx-vercel-ai\n\n> Vercel AI SDK integration for the [Preference Profile Exchange (PPX)](https://blazing-customs.github.io/ppx-spec/).\n\n## Install\n\n```bash\nnpm i @blazing-customs/ppx-vercel-ai ai zod\n```\n\nRequires Node 18.17+. Published version: **0.1.0-alpha.1** ([npm](https://www.npmjs.com/package/@blazing-customs/ppx-vercel-ai)).\n\n> Alpha, tracking a **draft** specification. Expect breaking changes.\n\n## Tool for a chat agent\n\n```ts\nimport { streamText } from \"ai\";\nimport { openai } from \"@ai-sdk/openai\";\nimport { PpxClient } from \"@blazing-customs/ppx-client\";\nimport { preferenceTool } from \"@blazing-customs/ppx-vercel-ai\";\n\nconst ppx = new PpxClient({ baseUrl: \"https://api.provider.app\" });\n\nconst result = await streamText({\n  model: openai(\"gpt-4o-mini\"),\n  messages,\n  tools: {\n    lookup_user_preference: preferenceTool({\n      client: ppx,\n      grantToken: grantScopedAccessToken,\n    }),\n  },\n});\n```\n\n## React hook: `usePpxConsent`\n\nHandles the full browser-side consent dance — cached grant refresh,\nredirect to consent page, callback handling, disconnect.\n\n```tsx\n\"use client\";\nimport { PpxClient } from \"@blazing-customs/ppx-client\";\nimport { usePpxConsent } from \"@blazing-customs/ppx-vercel-ai/react\";\n\nconst ppx = new PpxClient({ baseUrl: \"https://api.provider.app\" });\n\nexport function Connect() {\n  const { state, start, disconnect } = usePpxConsent({\n    client: ppx,\n    clientId: \"my-app\",\n    returnTo: \"http://localhost:3000/\",\n    providerFrontendUrl: \"http://localhost:7703\",\n  });\n\n  if (state.status === \"approved\") {\n    // Pass `state.accessToken` to your tool calls\n    return <button onClick={disconnect}>Disconnect</button>;\n  }\n\n  return (\n    <button\n      onClick={() =>\n        start({\n          subject_id: \"did:example:user-123\",\n          purposes: [\"recommendation\"],\n          allowed_domains: [\"fragrance\"],\n          allowed_namespaces: [\"fragrance\"],\n          allowed_operations: [\"read\"],\n          cross_domain_transfer: \"deny\",\n          writeback_policy: \"review_required\",\n          requested_duration_days: 30,\n        })\n      }\n    >\n      Connect to PPX\n    </button>\n  );\n}\n```\n\n## License\n\nApache-2.0.\n","readmeFilename":"README.md"}