@8xlabsai/hekaya-sdk-react
v0.2.1
Published
React wrapper around @8xlabsai/hekaya-sdk-core — drop-in <HekayaWidget /> component.
Readme
@8xlabsai/hekaya-sdk-react
React 18+ wrapper around @8xlabsai/hekaya-sdk-core. Drop a <HekayaWidget /> anywhere in your tree and the embeddable AI sales agent mounts/unmounts with the component lifecycle.
Install
pnpm add @8xlabsai/hekaya-sdk-react @8xlabsai/hekaya-sdk-corePeer dep: react >= 18.
Quickstart
import { HekayaWidget } from '@8xlabsai/hekaya-sdk-react';
export function App() {
return (
<>
<YourApp />
<HekayaWidget
tenantPublicKey="pk_live_…"
orchestratorUrl="https://api.hekaya.ai"
/>
</>
);
}The widget mounts on first render, follows the visitor across SPA routes, and unmounts when the component unmounts. Supports the same config surface as mount() from sdk-core (branding overrides, position, primary/accent colors, radius).
Next.js App Router
The widget is client-only (touches window/document). Wrap it in a client component:
// app/_components/Hekaya.tsx
'use client';
import { HekayaWidget } from '@8xlabsai/hekaya-sdk-react';
export function Hekaya() {
return (
<HekayaWidget
tenantPublicKey={process.env.NEXT_PUBLIC_HEKAYA_KEY!}
orchestratorUrl="https://api.hekaya.ai"
/>
);
}
// app/layout.tsx
import { Hekaya } from './_components/Hekaya';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html><body>{children}<Hekaya /></body></html>
);
}Source
Monorepo: github.com/8xlabs-ai/hekaya.ai → packages/sdk-react/.
License
MIT
