{"name":"@ai-sdk/react","version":"3.0.318","keywords":["ai","react"],"license":"Apache-2.0","_id":"@ai-sdk/react@3.0.318","maintainers":[{"name":"vercel-release-bot","email":"infra+release@vercel.com"},{"name":"matheuss","email":"matheus.frndes@gmail.com"},{"name":"matt.straka","email":"matt.j.straka@gmail.com"}],"homepage":"https://ai-sdk.dev/docs","bugs":{"url":"https://github.com/vercel/ai/issues"},"dist":{"shasum":"e566c778e5b47d64c40098858e87e6f4695770f0","tarball":"http://registry-npm.ywwl.com/@ai-sdk/react/download/@ai-sdk/react-3.0.318.tgz","fileCount":19,"integrity":"sha512-rh4E7DIY6/3jGbUM/DZASmE4KP7XXFkkqljXRwVVVUD+GInsG6eF7LlU9YWG7iRjLBxxgUF/zkYjF7/AVqtCMQ==","signatures":[{"sig":"MEQCIE3zq7ZxADimH8/s6Kw0MSOFzw9r6OchbHGVwqNw3w+WAiBM3q0joz0dXx55zm2j3w56jn1oZO1x/VVxEd8+DttJPQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCl9TvMLLR1q/2JU0AJmTUIjVxXnUMsZLdNUXh2S4eaRQIgDBBMrTkKDnIROJ98WgJyK6wfs0MsGbyPnIqhzw3cGWA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ai-sdk%2freact@3.0.318","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":241401,"size":52302,"noattachment":false,"key":"/@ai-sdk/react/-/@ai-sdk/react-3.0.318.tgz"},"main":"./dist/index.js","_from":"file:ai-sdk-react-3.0.318.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest --config vitest.config.js --run","build":"pnpm clean && tsup --tsconfig tsconfig.build.json","clean":"del-cli dist *.tsbuildinfo","test:watch":"vitest --config vitest.config.js","type-check":"tsc --build","build:watch":"pnpm clean && tsup --watch --tsconfig tsconfig.build.json","test:update":"vitest --config vitest.config.js --run -u"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"422789b8-ee0b-48b3-b615-8b20fc7960ca"}},"_resolved":"/tmp/52a9510ac1872017c947249e5dda437c/ai-sdk-react-3.0.318.tgz","_integrity":"sha512-rh4E7DIY6/3jGbUM/DZASmE4KP7XXFkkqljXRwVVVUD+GInsG6eF7LlU9YWG7iRjLBxxgUF/zkYjF7/AVqtCMQ==","repository":{"url":"git+https://github.com/vercel/ai.git","type":"git","directory":"packages/react"},"_npmVersion":"11.19.0","description":"[React](https://react.dev/) UI components for the [AI SDK](https://ai-sdk.dev/docs):","directories":{},"sideEffects":false,"_nodeVersion":"24.21.0","dependencies":{"ai":"6.0.315","swr":"^2.2.5","throttleit":"2.1.0","@ai-sdk/provider-utils":"4.0.62"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"msw":"2.6.4","zod":"3.25.76","tsup":"^7.2.0","jsdom":"^24.0.0","react-dom":"^18 || ^19","typescript":"5.8.3","@types/node":"20.17.24","@types/react":"^18","@types/react-dom":"^18","@ai-sdk/test-server":"1.0.6","@vercel/ai-tsconfig":"0.0.0","@testing-library/react":"^16.0.1","@testing-library/jest-dom":"^6.6.3","@testing-library/user-event":"^14.5.2"},"peerDependencies":{"react":"^18 || ~19.0.1 || ~19.1.2 || ^19.2.1"},"_npmOperationalInternal":{"tmp":"tmp/react_3.0.318_1792784464559_0.7379578366338195","host":"s3://npm-registry-packages-npm-production"},"readme":"# AI SDK - React integration\n\n[React](https://react.dev/) UI components for the [AI SDK](https://ai-sdk.dev/docs):\n\n## Setup\n\n```bash\nnpm i ai @ai-sdk/react\n```\n\n## Usage\n\n```tsx\n'use client';\n\nimport { useChat } from '@ai-sdk/react';\nimport { DefaultChatTransport } from 'ai';\nimport { useState } from 'react';\n\nexport default function Page() {\n  const { messages, sendMessage, status } = useChat({\n    transport: new DefaultChatTransport({\n      api: '/api/chat',\n    }),\n  });\n  const [input, setInput] = useState('');\n\n  return (\n    <>\n      {messages.map(message => (\n        <div key={message.id}>\n          {message.role === 'user' ? 'User: ' : 'AI: '}\n          {message.parts.map((part, index) =>\n            part.type === 'text' ? <span key={index}>{part.text}</span> : null,\n          )}\n        </div>\n      ))}\n\n      <form\n        onSubmit={e => {\n          e.preventDefault();\n          if (input.trim()) {\n            sendMessage({ text: input });\n            setInput('');\n          }\n        }}\n      >\n        <input\n          value={input}\n          onChange={e => setInput(e.target.value)}\n          disabled={status !== 'ready'}\n          placeholder=\"Say something...\"\n        />\n        <button type=\"submit\" disabled={status !== 'ready'}>\n          Submit\n        </button>\n      </form>\n    </>\n  );\n}\n```\n\nSee the [React documentation](https://ai-sdk.dev/docs/ai-sdk-ui/chatbot) for more information.\n","publish_time":1792784464648,"_cnpm_publish_time":1792784464648,"dist-tags":{"ai-v5":"2.0.289","ai-v6":"3.0.329","alpha":"2.0.0-alpha.15","beta":"4.0.0-beta.192","canary":"4.0.0-canary.180","latest":"4.0.170","snapshot":"0.0.0-f1630544-20260811180950"}}