{"_id":"@1kairoos/aics-react","_rev":"13-0aab4e4bf3f51e228bfc907094742ea1","name":"@1kairoos/aics-react","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.4":{"name":"@1kairoos/aics-react","version":"0.1.4","keywords":["aics","chat","react","sdk"],"license":"UNLICENSED","_id":"@1kairoos/aics-react@0.1.4","maintainers":[{"name":"robyoon","email":"rob@1zlabs.com"}],"dist":{"shasum":"39c58aa51900b9d146ad7bc6fbbae612d382bd38","tarball":"https://registry.npmjs.org/@1kairoos/aics-react/-/aics-react-0.1.4.tgz","fileCount":6,"integrity":"sha512-x9/VMKGuZBLKfx3uAu/ot16joTNgPNfZp2f1hJfUUojefh9vVqjqk1DwbTHuf8kx894nagkz948ZHkUrk+vcqw==","signatures":[{"sig":"MEUCIEB9lUufvMTYKEZ5Uoz6uIMQlfJTZRaRwF3qFdZ8ct9FAiEAjaIV+G2PR2jEtLT1bQlEAI4T6n+XdUqSoF9QQRGjejA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10965},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"6b891faf2f86c9c918ea43198b0e2e1f317861c4","scripts":{"build":"tsup src/index.tsx --format esm,cjs --dts --external react --external react-dom --external @1kairoos/aics-core","prepack":"npm run build","typecheck":"tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"robyoon","email":"rob@1zlabs.com"},"_npmVersion":"11.2.0","description":"React bindings for AICS chat integrations.","directories":{},"sideEffects":false,"_nodeVersion":"20.19.0","dependencies":{"@1kairoos/aics-core":"0.1.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/aics-react_0.1.4_1778053939654_0.41079739736480536","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@1kairoos/aics-react","version":"0.2.0","keywords":["aics","chat","react","sdk"],"license":"UNLICENSED","_id":"@1kairoos/aics-react@0.2.0","maintainers":[{"name":"robyoon","email":"rob@1zlabs.com"}],"dist":{"shasum":"6b6c283a4efd3865d9d6ab5811dcc7dcf5e18eb5","tarball":"https://registry.npmjs.org/@1kairoos/aics-react/-/aics-react-0.2.0.tgz","fileCount":6,"integrity":"sha512-sd3ucfroyOfYM9tOxHt6Ee1v2YEZoBvCV+VwLmNyAdqNyy7l05PSMNu5EYQDcY+1lpjCODrzH0G1Ia2NSTztYg==","signatures":[{"sig":"MEUCIE9wUc1gBBjr9DPFXbynS+2JvOaKgcefeRWajlLLoBNbAiEA26VFSPbB8Tsl3ydUnpDh7GVjmKFZf1vFv4n7cpJ8S1M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11199},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"a27d38bd29aa5e515b89473fcaefbab1b947b252","scripts":{"build":"tsup src/index.tsx --format esm,cjs --dts --external react --external react-dom --external @1kairoos/aics-core","prepack":"npm run build","typecheck":"tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"robyoon","email":"rob@1zlabs.com"},"_npmVersion":"11.7.0","description":"React bindings for AICS chat integrations.","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","dependencies":{"@1kairoos/aics-core":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/aics-react_0.2.0_1780029503338_0.43895033993087673","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@1kairoos/aics-react","version":"0.2.1","description":"React bindings for AICS chat integrations.","license":"UNLICENSED","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.tsx --format esm,cjs --dts --external react --external react-dom --external @1kairoos/aics-core","prepack":"npm run build","test":"npm run build && node --test test/events.test.mjs","typecheck":"tsc --noEmit -p tsconfig.json"},"publishConfig":{"access":"public"},"keywords":["aics","chat","react","sdk"],"dependencies":{"@1kairoos/aics-core":"0.2.1"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"devDependencies":{"react-test-renderer":"^19.1.0"},"_id":"@1kairoos/aics-react@0.2.1","_nodeVersion":"20.19.5","_npmVersion":"11.7.0","dist":{"integrity":"sha512-Dc+Yh/2G9MISK+uF58+sITolzp14mflZsjrWQi4+GiyxwGNBs4PFZ0DBOPLQTMoQkocU0z7078miF1v263WYSw==","shasum":"36ca7abf34ff999527664ce4d2b445e0fb5a8462","tarball":"https://registry.npmjs.org/@1kairoos/aics-react/-/aics-react-0.2.1.tgz","fileCount":6,"unpackedSize":13191,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGPd6s/IcW+5TsDnUkendWEtk7wv+/UXOtl0BTT8+SqlAiBjS2XdA1Yn6vyVufiV0ln+cEoXAuLq7Un8YzYya/dLEg=="}]},"_npmUser":{"name":"robyoon","email":"rob@1zlabs.com"},"directories":{},"maintainers":[{"name":"robyoon","email":"rob@1zlabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aics-react_0.2.1_1785566765805_0.7556351253142801"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-27T10:10:31.035Z","modified":"2026-08-01T06:46:06.241Z","0.1.0":"2026-04-27T10:10:31.299Z","0.1.1":"2026-04-27T15:44:32.417Z","0.1.2":"2026-04-27T23:09:12.457Z","0.1.3":"2026-04-27T23:18:37.220Z","0.1.4":"2026-05-06T07:52:19.832Z","0.2.0":"2026-05-29T04:38:23.472Z","0.2.1":"2026-08-01T06:46:05.947Z"},"license":"UNLICENSED","keywords":["aics","chat","react","sdk"],"description":"React bindings for AICS chat integrations.","maintainers":[{"name":"robyoon","email":"rob@1zlabs.com"}],"readme":"# @1kairoos/aics-react\n\nReact provider and hooks for AICS chat integrations.\n\n## Install\n\nThis package is distributed as a public npm package.\n\n```bash\nnpm install @1kairoos/aics-core @1kairoos/aics-react\n```\n\n## Usage\n\n```tsx\nimport { createAicsClient } from \"@1kairoos/aics-core\";\nimport { AicsProvider, useAicsChat } from \"@1kairoos/aics-react\";\n\nconst client = createAicsClient({\n  endpoint: {\n    apiBaseUrl: \"https://api.example.com\",\n    tokenExchangeUrl: \"https://api.example.com/aics/token/verify\",\n    wsUrl: \"wss://api.example.com/cable\"\n  },\n  session: {\n    mode: \"host_managed\",\n    getChatJoinToken: async () => {\n      const response = await fetch(\"/chat/join-token\");\n      return response.json();\n    }\n  }\n});\n\nfunction Chat() {\n  const {\n    closeSession,\n    connect,\n    getSession,\n    messages,\n    sendMessage,\n    sendTyping,\n    submitSurvey\n  } = useAicsChat();\n  // Build your WebView UI with the normalized SDK state.\n}\n\nexport function App() {\n  return (\n    <AicsProvider client={client}>\n      <Chat />\n    </AicsProvider>\n  );\n}\n```\n\n`closeSession({ reason: \"cancel_livechat_waiting\" })` is a live-chat queue\ncancel flow, not a terminal session close. The hook exposes the core SDK union\nresult so UI code can distinguish `closed: true` from `canceledHandoff: true`.\n\nThis package is intended for controlled integration environments.\n\n## Event subscriptions\n\n`useAicsEvents()` subscribes after render and automatically unsubscribes when\nthe component unmounts or when the client, event type, or listener changes.\nMemoize the listener when it should remain subscribed across renders.\n\n```tsx\nimport { useCallback } from \"react\";\nimport type { AicsEvent } from \"@1kairoos/aics-core\";\nimport { useAicsEvents } from \"@1kairoos/aics-react\";\n\nconst onMessage = useCallback((event: AicsEvent) => {\n  console.log(event.payload);\n}, []);\n\nconst unsubscribe = useAicsEvents(\"message.created\", onMessage);\n```\n\nThe returned `unsubscribe` function remains available for callers that need to\nstop listening before unmount.\n","readmeFilename":"README.md"}