@coristen/widget 0.1.1 → 0.1.2
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 +39 -39
- package/dist/api.d.ts +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -16876
- package/dist/load-error.d.ts +1 -0
- package/dist/server.js +1 -69
- package/dist/styles.css +1 -1
- package/package.json +70 -70
package/README.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# @coristen/widget
|
|
2
|
-
|
|
3
|
-
Install the Coristen customer-experience widget in any React application.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npm install @coristen/widget
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
```tsx
|
|
10
|
-
import { CoristenWidget } from "@coristen/widget"
|
|
11
|
-
import "@coristen/widget/styles.css"
|
|
12
|
-
|
|
13
|
-
export default function App() {
|
|
14
|
-
return <CoristenWidget apiKey="coristen_pk_..." />
|
|
15
|
-
}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Public websites use `apiKey`; visitors are remembered in that browser. For an
|
|
19
|
-
authenticated app, use an identity route instead so conversations follow the
|
|
20
|
-
signed-in customer:
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
<CoristenWidget identity="/api/coristen/identity" />
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Create the route with the server-only helper:
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
import { coristenIdentity } from "@coristen/widget/server"
|
|
30
|
-
|
|
31
|
-
export const { GET } = coristenIdentity(async (request) => {
|
|
32
|
-
const user = await getSignedInUser(request)
|
|
33
|
-
return user ? { id: user.id, name: user.name, email: user.email } : null
|
|
34
|
-
})
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Set `CORISTEN_KEY` on the server when using identity mode. Identity mode renders
|
|
38
|
-
only for a verified signed-in customer; it never falls back to anonymous access.
|
|
39
|
-
Use `apiUrl="http://localhost:3000"` while developing Coristen locally.
|
|
1
|
+
# @coristen/widget
|
|
2
|
+
|
|
3
|
+
Install the Coristen customer-experience widget in any React application.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @coristen/widget
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { CoristenWidget } from "@coristen/widget"
|
|
11
|
+
import "@coristen/widget/styles.css"
|
|
12
|
+
|
|
13
|
+
export default function App() {
|
|
14
|
+
return <CoristenWidget apiKey="coristen_pk_..." />
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Public websites use `apiKey`; visitors are remembered in that browser. For an
|
|
19
|
+
authenticated app, use an identity route instead so conversations follow the
|
|
20
|
+
signed-in customer:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<CoristenWidget identity="/api/coristen/identity" />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Create the route with the server-only helper:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { coristenIdentity } from "@coristen/widget/server"
|
|
30
|
+
|
|
31
|
+
export const { GET } = coristenIdentity(async (request) => {
|
|
32
|
+
const user = await getSignedInUser(request)
|
|
33
|
+
return user ? { id: user.id, name: user.name, email: user.email } : null
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Set `CORISTEN_KEY` on the server when using identity mode. Identity mode renders
|
|
38
|
+
only for a verified signed-in customer; it never falls back to anonymous access.
|
|
39
|
+
Use `apiUrl="http://localhost:3000"` while developing Coristen locally.
|
package/dist/api.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export type ChatMessage = {
|
|
|
6
6
|
inReplyTo?: string;
|
|
7
7
|
generationStatus?: "generating" | "complete" | "failed";
|
|
8
8
|
generationError?: string;
|
|
9
|
-
model?: string;
|
|
10
9
|
citations?: Array<{
|
|
11
10
|
sourceId: string;
|
|
12
11
|
title: string;
|
|
@@ -28,6 +27,8 @@ export type ChatAttachment = {
|
|
|
28
27
|
};
|
|
29
28
|
export type WidgetSettings = {
|
|
30
29
|
name: string;
|
|
30
|
+
agentName: string;
|
|
31
|
+
agentImageUrl: string | null;
|
|
31
32
|
brandColor: string;
|
|
32
33
|
welcomeMessage: string;
|
|
33
34
|
privacyPolicyUrl: string;
|
|
@@ -41,9 +42,6 @@ export type WidgetSettings = {
|
|
|
41
42
|
radius: "none" | "sm" | "md" | "lg";
|
|
42
43
|
bubbleIcon: string;
|
|
43
44
|
bubbleColor: string;
|
|
44
|
-
bubbleShowText: boolean;
|
|
45
|
-
bubbleText: string;
|
|
46
|
-
bubbleIconPosition: "left" | "right";
|
|
47
45
|
showPoweredBy: boolean;
|
|
48
46
|
maxAttachmentSizeMb: number;
|
|
49
47
|
allowedAttachmentTypes: string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type CoristenWidgetProps = CoristenWidgetOptions & ({
|
|
|
14
14
|
identity: string;
|
|
15
15
|
apiKey?: never;
|
|
16
16
|
});
|
|
17
|
-
export type WidgetAppearance = Partial<Pick<WidgetSettings, "brandColor" | "position" | "theme" | "tintedGrayscale" | "accentEnabled" | "accentHeader" | "accentSendIcon" | "radius" | "bubbleIcon" | "bubbleColor" | "
|
|
17
|
+
export type WidgetAppearance = Partial<Pick<WidgetSettings, "brandColor" | "position" | "theme" | "tintedGrayscale" | "accentEnabled" | "accentHeader" | "accentSendIcon" | "radius" | "bubbleIcon" | "bubbleColor" | "showPoweredBy">>;
|
|
18
18
|
export declare function CoristenWidget({ identity, apiKey, apiUrl, defaultOpen, fontSize, appearance, onReady, onError, }: CoristenWidgetProps): import("react").JSX.Element | null;
|
|
19
19
|
export type { WidgetSettings } from "./api";
|
|
20
20
|
export declare const coristenWidget: {
|