goji-search
v3.0.6
Published
Embeddable GojiSearch components for both React and vanilla JS
Readme
Goji Search
AI-powered chat widget for websites. Embeddable as a React component, Web Component, or vanilla JS widget.
Features
- Real-time streaming chat via WebSocket
- Multi-tenant support with company-specific branding
- Returning visitor detection and personalized welcome messages
- Idle re-engagement prompts
- Deep analysis cards (ROI, comparisons, cost breakdowns)
- CTA cards with calendar booking and email capture
- Multi-language support (EN, FR, IT, ES, DE)
- Voice transcription
- Shadow DOM style isolation for embedding
- Gated debug logging
Installation
npm install goji-search
# or
yarn add goji-searchQuick Start
React
import { GojiSearchComponent } from 'goji-search';
function App() {
return (
<GojiSearchComponent
companyId="your-company-id"
apiKey="goji_yourcompany_prod_xxx"
apiUrl="https://api.getgoji.ai"
/>
);
}HTML / Vanilla JS
<script src="https://cdn.getgoji.ai/widget.js"></script>
<script>
GojiWidget.init({
companyId: 'your-company-id',
apiKey: 'goji_yourcompany_prod_xxx',
apiUrl: 'https://api.getgoji.ai'
});
</script>Props
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| companyId | string | Yes | Your company identifier |
| apiKey | string | Yes | Your Goji API key |
| apiUrl | string | No | Backend API URL (default: http://localhost:8000) |
| aiColor | string | No | AI avatar color in HEX (falls back to brand color from company theme) |
| userMessageBackgroundColor | string | No | User message bubble background color |
Exports
// React component and error boundary
import { GojiSearchComponent, GojiSearchErrorBoundary } from 'goji-search';
// API client
import { GojiSearchClient, createGojiClient } from 'goji-search';
// Hooks
import { useReturningVisitor, useVisitorId } from 'goji-search';
// UTM and visitor utilities
import { captureVisitorContext, getVisitorContext, getOrCreateVisitorId } from 'goji-search';Development
npm install # Install dependencies
npm run dev # Development server
npm run build # Build React library + widget bundle
npm run lint # Lint
npm run test # Run tests (watch mode)
npm run test:run # Run tests once
npm run test:coverage # Run tests with coverageDocumentation
See docs/README.md for the frontend documentation index.
See USAGE.md for detailed documentation, advanced usage, and API reference.
See docs/FRONTEND_STATE_AND_TRANSPORT_MAP.md for the widget architecture map, state ownership, and backend transport contract.
See CHANGELOG.md for version history.
