@akropolys/kiku 2.2.26 → 2.2.28
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 +48 -37
- package/dist/embed/embed.js +15 -15
- package/dist/embed/meta.json +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,78 +1,89 @@
|
|
|
1
1
|
# @akropolys/kiku
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Chat, search, voice, and photo input for your website. Kiku connects visitors to your content and the API actions you configure in Akropolys.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@akropolys/kiku) [](https://opensource.org/licenses/MIT) [](https://www.typescriptlang.org/)
|
|
6
6
|
|
|
7
|
-
---
|
|
8
|
-
|
|
9
7
|
## Install
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
10
|
npm install @akropolys/kiku @akropolys/sdk
|
|
13
|
-
# or
|
|
14
|
-
pnpm add @akropolys/kiku @akropolys/sdk
|
|
15
11
|
```
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Requires React and React DOM 17 or later. For websites without React, use the [script embed](https://github.com/akropolys/sdk/blob/HEAD/packages/kiku/EMBED.md).
|
|
18
14
|
|
|
19
|
-
##
|
|
15
|
+
## React and Next.js
|
|
20
16
|
|
|
21
17
|
```tsx
|
|
18
|
+
'use client';
|
|
19
|
+
|
|
22
20
|
import { AkropolysProvider } from '@akropolys/sdk';
|
|
23
21
|
import { KikuButton } from '@akropolys/kiku';
|
|
24
|
-
import '@akropolys/kiku/styles.css';
|
|
22
|
+
import '@akropolys/kiku/styles.css';
|
|
25
23
|
|
|
26
|
-
export default function
|
|
24
|
+
export default function WebsiteAssistant() {
|
|
27
25
|
return (
|
|
28
26
|
<AkropolysProvider
|
|
29
27
|
siteId={process.env.NEXT_PUBLIC_AKROPOLYS_SITE_ID!}
|
|
30
28
|
apiUrl={process.env.NEXT_PUBLIC_AKROPOLYS_API_URL!}
|
|
31
|
-
apiToken={process.env.
|
|
29
|
+
apiToken={process.env.NEXT_PUBLIC_AKROPOLYS_API_TOKEN!}
|
|
32
30
|
>
|
|
33
|
-
<KikuButton
|
|
34
|
-
label="Ask me anything"
|
|
35
|
-
enableVoice={true}
|
|
36
|
-
enableVision={true}
|
|
37
|
-
theme={{
|
|
38
|
-
borderRadius: "24px",
|
|
39
|
-
}}
|
|
40
|
-
/>
|
|
31
|
+
<KikuButton label="Ask us" enableVoice enableVision />
|
|
41
32
|
</AkropolysProvider>
|
|
42
33
|
);
|
|
43
34
|
}
|
|
44
35
|
```
|
|
45
36
|
|
|
46
|
-
|
|
37
|
+
Mount the component once in your app or layout. In Next.js App Router, import the stylesheet in your root layout if that is where your project keeps global CSS.
|
|
38
|
+
|
|
39
|
+
Use your site's public browser token. Keep private keys and server credentials on your server. Enable the corresponding voice and vision features for your site in Shell.
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
## What visitors can do
|
|
49
42
|
|
|
50
|
-
|
|
43
|
+
- Ask about your content and compare records in tables.
|
|
44
|
+
- Talk using live voice or include photos in a conversation.
|
|
45
|
+
- Open source records and save items for later.
|
|
46
|
+
- Long-press or right-click a message to access its actions.
|
|
47
|
+
- Use translated controls, right-to-left layouts, and chat themes.
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
## Components
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
| Component | Purpose |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `KikuButton` | A launcher that opens the chat window. |
|
|
54
|
+
| `SearchBar` | Inline search with streamed results. |
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Both components use `AkropolysProvider` from `@akropolys/sdk`.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
## Customize the launcher
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
```tsx
|
|
61
|
+
<KikuButton
|
|
62
|
+
label="Ask about this property"
|
|
63
|
+
title="Your assistant"
|
|
64
|
+
placeholder="What would you like to know?"
|
|
65
|
+
chips={['Show available properties', 'Compare my options']}
|
|
66
|
+
theme="dark"
|
|
67
|
+
enableVoice
|
|
68
|
+
enableVision
|
|
69
|
+
/>
|
|
70
|
+
```
|
|
61
71
|
|
|
62
|
-
|
|
63
|
-
|---|---|
|
|
64
|
-
| `<KikuButton />` | Launcher pill that opens the full-screen chat, with live voice and vision. |
|
|
65
|
-
| `<SearchBar />` | Inline catalogue search with streamed results. |
|
|
66
|
-
| `<ScoutRail />` | Dock for the shopper's scouts: send one out, check on it, buy time. |
|
|
67
|
-
| `<ScoutCharacter />` | A single animated scout avatar. |
|
|
72
|
+
`theme` accepts `light`, `dark`, or an `AkropolysTheme` object from `@akropolys/sdk`. Use `onSelectSource` to handle a visitor selecting a source record.
|
|
68
73
|
|
|
74
|
+
## Your content and actions
|
|
69
75
|
|
|
70
|
-
|
|
76
|
+
Give each catalogue record a stable top-level `id`. A webpage link in `fields.url` is optional; Kiku can show and save records without one. See the [SDK ingestion guide](https://github.com/akropolys/sdk/blob/HEAD/packages/sdk/README.md#batch-ingestion-on-your-server).
|
|
71
77
|
|
|
72
|
-
|
|
78
|
+
Configure action endpoints, HTTP methods, and request fields in Shell. Kiku collects the required values and presents the result returned by your backend. Your endpoint validates the request and performs the operation. See the [site actions guide](https://github.com/akropolys/sdk/blob/HEAD/packages/sdk/README.md#site-actions).
|
|
73
79
|
|
|
74
|
-
|
|
80
|
+
## Links
|
|
75
81
|
|
|
76
|
-
|
|
82
|
+
- [Akropolys](https://akropolys.cloud)
|
|
83
|
+
- [Source code](https://github.com/akropolys/sdk)
|
|
84
|
+
- [Plain HTML embed guide](https://github.com/akropolys/sdk/blob/HEAD/packages/kiku/EMBED.md)
|
|
85
|
+
- [Headless SDK](https://www.npmjs.com/package/@akropolys/sdk)
|
|
77
86
|
|
|
78
|
-
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT © [Akropolys](https://akropolys.cloud)
|