andy-widget-react 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # andy-widget-react
2
+
3
+ The official React Widget for Andy. Its canonical source is
4
+ [`Andesphere/andy-sdk`](https://github.com/Andesphere/andy-sdk/tree/main/packages/react).
5
+
6
+ ## Install
7
+
8
+ Pin an exact reviewed release:
9
+
10
+ ```bash
11
+ bun add andy-widget-react@2.0.5
12
+ ```
13
+
14
+ React and React DOM 18 or 19 are required peer dependencies.
15
+
16
+ ## Use
17
+
18
+ ```tsx
19
+ 'use client'
20
+
21
+ import { AndyChat, setApiBaseUrl } from 'andy-widget-react'
22
+
23
+ setApiBaseUrl('https://app.andypartner.com/api')
24
+
25
+ export function SupportWidget() {
26
+ return <AndyChat embedId='your-agent-id' />
27
+ }
28
+ ```
29
+
30
+ `embedId` is the non-secret Andy Agent ID. The Widget fetches its effective configuration from
31
+ `GET /api/chatbot/:embedId` and sends visitor messages to `POST /api/messages`. The browser sends
32
+ the embedding page's `Origin`; Andy enforces the Agent's exact allowed-origin configuration.
33
+
34
+ The launcher starts closed. If the Agent ID is invalid or configuration cannot be loaded, the
35
+ Widget renders no launcher and does not affect the host page. Message failures remain inside the
36
+ Widget as a short, language-aware retry message.
37
+
38
+ ## Props
39
+
40
+ | Prop | Type | Purpose |
41
+ | --- | --- | --- |
42
+ | `embedId` | `string` | Required Agent ID outside preview mode |
43
+ | `tooltip` | `string` | Optional launcher tooltip |
44
+ | `name` | `string` | Override the configured Agent name |
45
+ | `headline` | `string` | Override the configured headline |
46
+ | `description` | `string` | Override the configured description |
47
+ | `welcomeMessage` | `string` | Override the configured first message |
48
+ | `bubbleLabel` | `string` | Override the configured pill label |
49
+ | `theme` | `'light' \| 'dark' \| 'auto'` | Override the configured theme |
50
+ | `orientation` | `'left' \| 'right'` | Override the configured position |
51
+ | `brandColor` | `string` | Override the configured six-digit hex color |
52
+ | `bubbleStyle` | `'icon' \| 'pill'` | Override the configured launcher style |
53
+ | `useBrandColor` | `boolean` | Override configured brand-color use |
54
+ | `logoUrl` | `string` | Override the configured logo |
55
+ | `previewMode` | `boolean` | Render local prop-based preview configuration |
56
+ | `initialOpen` | `boolean` | Opt into an initially open Widget; defaults to `false` |
57
+
58
+ The server configuration controls **Powered by Andy** visibility. Consumers cannot suppress it
59
+ with a prop. FAQ entries render only when the API supplies both a question and an answer; the
60
+ current question-only response safely exposes no incomplete FAQ. Visitor-information and lead
61
+ capture are disabled in this release because there is no durable public submission boundary.
62
+
63
+ This release intentionally has no Widget analytics or event callback API. Use Andy's existing
64
+ conversation analytics rather than observing the Shadow DOM.
65
+
66
+ ## Advanced exports
67
+
68
+ The package also exports `useAndyChat`, individual presentation components, its public TypeScript
69
+ types, design tokens, `getApiBaseUrl`, and `setApiBaseUrl`. `Andy` remains a compatibility alias
70
+ for `AndyChat`; new integrations should use `AndyChat`.
71
+
72
+ ## Supported integration path
73
+
74
+ Use the React package directly. Do not use an iframe, a floating `@latest` dependency, or Andy's
75
+ legacy hosted `/widget.js` redirect for new integrations.
76
+
77
+ ## License
78
+
79
+ MIT