{"_id":"@aimdoc/sdk-react","_rev":"8-b8382e013aabdb7189e026fe7ef18e4f","name":"@aimdoc/sdk-react","dist-tags":{"beta":"1.0.1","latest":"2.4.0"},"versions":{"1.0.0":{"name":"@aimdoc/sdk-react","version":"1.0.0","_id":"@aimdoc/sdk-react@1.0.0","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"dist":{"shasum":"e071228a4b82f4df97d504fe97034d7d47d5d1f9","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-1.0.0.tgz","fileCount":6,"integrity":"sha512-KQb+4vlyhzAH/wa6R+dPsiIF8tnILYY7Y4ytJeMAQlrVZwndE4DNkPF6uIi7G5olKa/dAzB47aDVF4d6PTwePQ==","signatures":[{"sig":"MEUCIQChpsznToLfu1Ur/7bhRiVM0b2mb5TLQ1WvPfWQdDeZPAIgSOIBknZAlQ4NM9cKsrkfr8DrjQ86Kd17kCfvO8xZPGk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8260},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"da69bf3ef79b033844878b7a489b2cee5b79bcef","scripts":{"dev":"tsup --watch","build":"tsup"},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"_npmVersion":"10.8.1","description":"The Aimdoc React SDK allows developers to provide rich context to Aimdoc's AI by embedding contextual information about components and users within their applications. This helps Aimdoc understand where it is in the application and associate user sessions","directories":{},"_nodeVersion":"22.4.0","dependencies":{"@aimdoc/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.0.0","@types/react":"^18.0.0"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-react_1.0.0_1738710793708_0.7633501483294562","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aimdoc/sdk-react","version":"1.0.1","_id":"@aimdoc/sdk-react@1.0.1","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"dist":{"shasum":"c23ba82bc90df240fc805eba2ff45cb8f2379bd6","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-1.0.1.tgz","fileCount":6,"integrity":"sha512-OGdBhzppcz93yB71pNnCYw0Q78dzb1K/gSowh/mRdv8XFBWptMpYCirzIcan552KmxZxSc5XM+eoLO9lSJV+Tg==","signatures":[{"sig":"MEYCIQCRXopLLBChbjphZmKp4m//ImqSzR1jdG7j/5LpobO3SgIhANlgpSQtHPgCSTukGT/Fl81fioXMV0KAN2jhspbNVLuq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10919},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"da69bf3ef79b033844878b7a489b2cee5b79bcef","scripts":{"dev":"tsup --watch","build":"tsup"},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"_npmVersion":"10.8.1","description":"The Aimdoc React SDK allows developers to provide rich context to Aimdoc's AI by embedding contextual information about components and users within their applications. This helps Aimdoc understand where it is in the application and associate user sessions","directories":{},"_nodeVersion":"22.4.0","dependencies":{"@aimdoc/sdk":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^8.0.0","typescript":"^5.0.0","@types/react":"^18.0.0"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-react_1.0.1_1738728055026_0.228196156663238","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aimdoc/sdk-react","version":"1.0.2","_id":"@aimdoc/sdk-react@1.0.2","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"dist":{"shasum":"aca03e6ff162173fd9fd9cbfd8e64449c6d10968","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-1.0.2.tgz","fileCount":6,"integrity":"sha512-gTwCzavTppI8+qquuPYtvyTbrIZ6MB0FYObssdquDdUtGey+015+QviEhdb8meuJFElRdgU4PMHxrV/fFAChSg==","signatures":[{"sig":"MEQCIBP3hHKv8YmqtxOGxx8gk36RFYeD1BZSCa6huIZ5vbR4AiBvVAMjmTZrvYW3eKtdboyDXaJOw5Nzvx1+sGlEnjwtjQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10919},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"da69bf3ef79b033844878b7a489b2cee5b79bcef","scripts":{"dev":"tsup --watch","build":"tsup"},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"_npmVersion":"10.8.1","description":"The Aimdoc React SDK allows developers to provide rich context to Aimdoc's AI by embedding contextual information about components and users within their applications. This helps Aimdoc understand where it is in the application and associate user sessions","directories":{},"_nodeVersion":"22.4.0","dependencies":{"@aimdoc/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.0.0","@types/react":"^18.0.0"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-react_1.0.2_1738728360164_0.7811854029222769","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@aimdoc/sdk-react","version":"2.0.0","license":"MIT","_id":"@aimdoc/sdk-react@2.0.0","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"dist":{"shasum":"75e2cc8e8b07319267dc0353e9a9cabcd912d390","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-2.0.0.tgz","fileCount":5,"integrity":"sha512-51lh19tZwLlr8vcxgn8jhjBtYCAyQLoFTwNrjB/RFIl5GwKwzpdPE10g3BZzSuMrefzr/BsrNaX0NtAqWZTFWQ==","signatures":[{"sig":"MEUCIHXRPE+i/bXEHZ+M4puasdIKNeAYRy5vrviRo9erwCYOAiEAz8/ORwcq5baAspEtWlHQr1Q0iTcxJ8aounpDUTa/A+s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8447},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"04c0a4fb6e4e49d8f86879a40fccf8fb1c1d348b","scripts":{"build":"tsup"},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"_npmVersion":"11.4.2","description":"Aimdoc React SDK — AimdocProvider and useAimdoc hook","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@aimdoc/sdk":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","typescript":"^5.7.3","@types/react":"^18.0.0"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-react_2.0.0_1772412277368_0.5298535795883639","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@aimdoc/sdk-react","version":"2.0.1","license":"MIT","_id":"@aimdoc/sdk-react@2.0.1","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"dist":{"shasum":"60103380c3885fc3fd1495996b64922c78029abe","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-2.0.1.tgz","fileCount":5,"integrity":"sha512-QyWt9fLsRRnllYDKt2iEZbsHkPwGOz6+ltBtlEGduXmXLkvo7IZByd1mPUnjbTzET2EcYxAOAekapbYJU4J3Cg==","signatures":[{"sig":"MEQCIE81J4i5YDzzSyZ7X6Wvjn6l9xiRWVN+GzMZXPEKn2oJAiBe2D0Kr/Uc/cW9EBnBRA3jh1rTCDNZO2yF3lh24c5cmw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8061},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"04c0a4fb6e4e49d8f86879a40fccf8fb1c1d348b","scripts":{"build":"tsup"},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"_npmVersion":"11.4.2","description":"Aimdoc React SDK — AimdocProvider and useAimdoc hook","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@aimdoc/sdk":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","typescript":"^5.7.3","@types/react":"^18.0.0"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-react_2.0.1_1772415888419_0.24193061708545427","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@aimdoc/sdk-react","version":"2.0.2","license":"MIT","_id":"@aimdoc/sdk-react@2.0.2","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"dist":{"shasum":"be2fc9362f62a1a00a6899e35963523d94944ee9","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-2.0.2.tgz","fileCount":5,"integrity":"sha512-6i83yxC4a3kS/ynUpvpwnFbp9SDzGXFVlUebo8mLgH7Qxn8d+Tgc5rtgwMPPR7wxINEu//tavmVgcg2xCJActQ==","signatures":[{"sig":"MEUCIHX3aR/AhaGEzjN+IznuSiL1YgGbyRxPN8o26X4ugWg3AiEApFCgoOBijVFeevO46ZssY+IC+g+KZfDpo51UJ7Xxx2E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8069},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"04c0a4fb6e4e49d8f86879a40fccf8fb1c1d348b","scripts":{"build":"tsup"},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"_npmVersion":"11.4.2","description":"Aimdoc React SDK — AimdocProvider and useAimdoc hook","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@aimdoc/sdk":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","typescript":"^5.7.3","@types/react":"^18.0.0"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-react_2.0.2_1772426486241_0.8644517060542938","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@aimdoc/sdk-react","version":"2.3.0","license":"MIT","_id":"@aimdoc/sdk-react@2.3.0","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"dist":{"shasum":"1ce7a72276f67dc6d3d99c3159fad1b6d3e4247a","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-2.3.0.tgz","fileCount":6,"integrity":"sha512-2LlmVU8FRtZNCSu990BsEYVinlo1YNYAkRO+viD0mebFBejYRtdRqru/uiElDvTdrtLKqGB+MwTZq2rFaqRosA==","signatures":[{"sig":"MEYCIQCvpMnY3hh3kngJw0SVUiIkN+l7nZZ3oh7yg+rQX3YW4QIhAIszaHD4jxy3nz2KIL3ywg3p0AdloCAoigtg9o84RlWp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":187604},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"d82ea376a1488de30671a937e9e6a96b8a234844","scripts":{"build":"tsup"},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"overrides":{"picomatch":"^4.0.5"},"_npmVersion":"11.4.2","description":"Aimdoc React SDK — Agent provider and direct Services reference catalog","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@aimdoc/sdk":"^2.6.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","typescript":"^5.7.3","@types/react":"^18.0.0"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-react_2.3.0_1787668689119_0.9285502040755642","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"@aimdoc/sdk-react","version":"2.4.0","description":"Aimdoc React SDK — Agent provider and direct Services reference catalog","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","scripts":{"build":"tsup"},"dependencies":{"@aimdoc/sdk":"^2.7.0"},"peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@types/react":"^18.0.0","tsup":"^8.3.6","typescript":"^5.7.3"},"overrides":{"picomatch":"^4.0.5"},"license":"MIT","_id":"@aimdoc/sdk-react@2.4.0","gitHead":"b7d3e7317e0ed06b897f949deae73bfd4debb125","_nodeVersion":"24.3.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-+CqcPfkT7vdhjYIlk3dMW05dl9rpGKvI1iMKhgwtpmt0iQ0wb01PmLMfnIZr1jlKRt4oAFrLyUqj+aGBDhjCjA==","shasum":"962842143d0cafbcad3b12aabad982845c8696ae","tarball":"https://registry.npmjs.org/@aimdoc/sdk-react/-/sdk-react-2.4.0.tgz","fileCount":6,"unpackedSize":211174,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA3HB3Xl9G3XJ3wJqXiSwOp2QxvguaAunOqDVbSoX2iPAiBmFgP0TZ6tPk3GjDtEm7EGtnfx52mQSjnszgE8RjFG3g=="}]},"_npmUser":{"name":"benjskoog","email":"ben@aimdoc.ai"},"directories":{},"maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-react_2.4.0_1787776573164_0.09529653264493287"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-04T23:13:13.591Z","modified":"2026-08-26T20:36:13.652Z","1.0.0":"2025-02-04T23:13:13.889Z","1.0.1":"2025-02-05T04:00:55.206Z","1.0.2":"2025-02-05T04:06:00.340Z","2.0.0":"2026-03-02T00:44:37.525Z","2.0.1":"2026-03-02T01:44:48.563Z","2.0.2":"2026-03-02T04:41:26.391Z","2.3.0":"2026-08-25T14:38:09.261Z","2.4.0":"2026-08-26T20:36:13.311Z"},"license":"MIT","description":"Aimdoc React SDK — Agent provider and direct Services reference catalog","maintainers":[{"name":"benjskoog","email":"ben@aimdoc.ai"}],"readme":"# Aimdoc React SDK\n\nReact bindings for the Aimdoc Agent and direct Services platform.\n\n## Managed catalog embed (recommended drop-in)\n\n`AimdocServicesEmbed` mounts an Aimdoc-hosted catalog page in an iframe. The\nnpm component is a thin, stable shim — all catalog UI is deployed by Aimdoc,\nso visual improvements and fixes reach your integration automatically, no\npackage upgrade required (the same model as Stripe Checkout / Elements).\nIdentity stays with your application: your backend signs each short-lived\nassertion and the component relays it; the iframe never sees your secrets or\nyour users' sessions.\n\n```tsx\nimport { AimdocServicesEmbed } from '@aimdoc/sdk-react';\n\nexport function CustomerServices() {\n  return (\n    <AimdocServicesEmbed\n      publishableKey={import.meta.env.VITE_AIMDOC_SERVICES_KEY}\n      getIdentityAssertion={async () => {\n        const response = await fetch('/api/aimdoc/services-identity');\n        if (!response.ok) throw new Error('Unable to identify Services user');\n        return response.text();\n      }}\n      theme={{ '--aimdoc-services-brand': '#0f766e' }}\n      onRunStarted={(run) => console.log('run', run.id)}\n    />\n  );\n}\n```\n\nThe iframe auto-sizes to its content. Omit `getIdentityAssertion` for an\nanonymous, discovery-only catalog. Theming crosses the boundary through the\n`theme` prop (the same `--aimdoc-services-*` variables listed below).\n\nPrefer the in-page component below when you want the catalog in your own DOM\nand are happy to take UI updates through package upgrades; prefer the hooks\nwhen you are building fully custom UI.\n\n## Services reference catalog\n\n`AimdocServiceCatalog` is Aimdoc's first-party customer catalog. It uses only\nthe direct `@aimdoc/sdk` Services client: there is no dashboard credential,\nwidget, iframe, or privileged endpoint. That makes it both a usable drop-in UI\nand a reference implementation for teams building their own catalog.\n\n```tsx\nimport { aimdoc } from '@aimdoc/sdk';\nimport { AimdocServiceCatalog } from '@aimdoc/sdk-react';\n\naimdoc.configureServices({\n  publishableKey: import.meta.env.VITE_AIMDOC_SERVICES_KEY,\n  getIdentityAssertion: async () => {\n    const response = await fetch('/api/aimdoc/services-identity');\n    if (!response.ok) throw new Error('Unable to identify Services user');\n    return response.text();\n  },\n});\n\nexport function CustomerServices() {\n  return <AimdocServiceCatalog client={aimdoc.services} />;\n}\n```\n\nThe component includes catalog cards, details, a schema-driven input form,\ndirect invocation, request-access and external-acquisition actions, live run\nstatus/results, and — for verified customers on services that allow it —\ncreating and managing scheduled automations. String inputs with JSON Schema\n`format: 'date'` use the catalog's calendar picker. Result markdown is rendered as\nsafe plain text by default; pass your application's trusted renderer when you\nwant rich markdown:\n\n```tsx\n<AimdocServiceCatalog\n  client={aimdoc.services}\n  renderMarkdown={(value) => <Markdown>{value}</Markdown>}\n/>\n```\n\nThe default design can be branded with CSS variables on a parent element:\n\n```css\n.customer-services {\n  --aimdoc-services-brand: #0f766e;\n  --aimdoc-services-brand-soft: #ccfbf1;\n  --aimdoc-services-canvas: #f8fafc;\n  --aimdoc-services-panel: #ffffff;\n  --aimdoc-services-ink: #172033;\n}\n```\n\n## Headless hooks — build a fully custom catalog\n\nThe reference component is markup over three exported hooks. Use them directly\nwhen you want your own design with the same engine — race-safe catalog\nloading, run polling to a terminal status, and automation lifecycle:\n\n- `useServiceCatalog(client, { initialServiceKey? })` — the subject's\n  effective catalog, a selection with detail refresh, `refresh`, and `select`.\n- `useServiceRun(client, { runId?, pollIntervalMs? })` — `track(run)` a run\n  you just started (or pass a `runId`) and read the live `run` until it\n  reaches a terminal status.\n- `useServiceAutomations(client, { autoLoad? })` — the verified customer's\n  automations plus `create(key, { schedule, inputBindings })` and\n  `manage(id, { action | schedule | ... })`.\n\nEvery hook takes the client as its first argument, so a test double or a\nwrapped client works the same as `aimdoc.services`. A minimal custom catalog:\n\n```tsx\nimport { aimdoc } from '@aimdoc/sdk';\nimport {\n  useServiceCatalog,\n  useServiceRun,\n  useServiceAutomations,\n} from '@aimdoc/sdk-react';\n\nexport function MyServicesPage() {\n  const { services, selected, select, loading, error } =\n    useServiceCatalog(aimdoc.services);\n  const { run, track } = useServiceRun(aimdoc.services);\n  const { automations, create, manage } = useServiceAutomations(aimdoc.services);\n\n  if (loading) return <Spinner />;\n  if (error) return <Alert>{error}</Alert>;\n\n  return (\n    <div className=\"grid\">\n      <ul>\n        {services.map((service) => (\n          <li key={service.offering_id}>\n            <button onClick={() => select(service)}>{service.name}</button>\n          </li>\n        ))}\n      </ul>\n      {selected && (\n        <section>\n          <h2>{selected.name}</h2>\n          {selected.allowed_actions.includes('invoke') && (\n            <button\n              onClick={async () => {\n                track(await aimdoc.services.invoke(selected.key));\n              }}\n            >\n              Run\n            </button>\n          )}\n          {selected.actions.create_automation && (\n            <button\n              onClick={() =>\n                create(selected.key, {\n                  schedule: { frequency: 'daily', at: '08:00' },\n                })\n              }\n            >\n              Run daily\n            </button>\n          )}\n          {run && <pre>{JSON.stringify(run.result, null, 2)}</pre>}\n          {automations\n            .filter((automation) => automation.service_key === selected.key)\n            .map((automation) => (\n              <div key={automation.id}>\n                {automation.schedule_description}\n                <button onClick={() => manage(automation.id, { action: 'cancel' })}>\n                  Cancel\n                </button>\n              </div>\n            ))}\n        </section>\n      )}\n    </div>\n  );\n}\n```\n\nThe hooks accept any object satisfying the exported `AimdocServicesClientLike`\ncontract — the automation methods are optional, and UI that depends on them\ndegrades gracefully when they are absent.\n","readmeFilename":"README.md"}