@contenify/chatbot 0.1.0 → 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 +101 -21
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,36 +1,116 @@
|
|
|
1
|
-
|
|
1
|
+
# @contenify/chatbot
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Contenify Chatbot is an embeddable AI assistant widget for websites and web applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It helps visitors understand your product, navigate pages, and get answers instantly — directly inside your interface.
|
|
6
|
+
The widget integrates in minutes and works as a 24/7 automated guide for your users.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
|
-
npm
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
npm install @contenify/chatbot
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Environment Configuration
|
|
19
|
+
|
|
20
|
+
Create or update your `.env.local` file:
|
|
21
|
+
|
|
22
|
+
```env
|
|
23
|
+
NEXT_PUBLIC_CONTENIFY_API_URL=https://your-api.com/api
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This URL should point to your Contenify backend API server.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Basic Usage (Next.js / React)
|
|
31
|
+
|
|
32
|
+
### 1. Import the component and stylesheet
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { ContenifyChatBot } from '@contenify/chatbot'
|
|
36
|
+
import '@contenify/chatbot/styles.css'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Add the component to your application root
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<ContenifyChatBot
|
|
43
|
+
onNavigate={(path) => router.push(path)}
|
|
44
|
+
onLogout={() => signOut()}
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The chatbot will automatically appear as a floating widget on your site.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Props
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Description |
|
|
55
|
+
| ------------ | ------------------------ | --------------------------------------------------- |
|
|
56
|
+
| `onNavigate` | `(path: string) => void` | Triggered when the chatbot requests page navigation |
|
|
57
|
+
| `onLogout` | `() => void` | Triggered when the chatbot requests user logout |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Where should I place it?
|
|
62
|
+
|
|
63
|
+
Place the component globally:
|
|
64
|
+
|
|
65
|
+
* **Next.js (App Router):** `app/layout.tsx`
|
|
66
|
+
* **React / Vite:** `App.tsx`
|
|
67
|
+
|
|
68
|
+
This ensures the chatbot is available on every page.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Full Example (Next.js)
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
'use client'
|
|
76
|
+
|
|
77
|
+
import { useRouter } from 'next/navigation'
|
|
78
|
+
import { ContenifyChatBot } from '@contenify/chatbot'
|
|
79
|
+
import '@contenify/chatbot/styles.css'
|
|
80
|
+
|
|
81
|
+
export default function ChatProvider() {
|
|
82
|
+
const router = useRouter()
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<ContenifyChatBot
|
|
86
|
+
onNavigate={(path) => router.push(path)}
|
|
87
|
+
onLogout={() => console.log('logout')}
|
|
88
|
+
/>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
15
91
|
```
|
|
16
92
|
|
|
17
|
-
|
|
93
|
+
---
|
|
18
94
|
|
|
19
|
-
|
|
95
|
+
## Requirements
|
|
20
96
|
|
|
21
|
-
|
|
97
|
+
* React 18+
|
|
98
|
+
* A running Contenify backend API server
|
|
22
99
|
|
|
23
|
-
|
|
100
|
+
---
|
|
24
101
|
|
|
25
|
-
|
|
102
|
+
## What Contenify Provides
|
|
26
103
|
|
|
27
|
-
|
|
28
|
-
|
|
104
|
+
* AI-powered website assistant
|
|
105
|
+
* User onboarding guidance
|
|
106
|
+
* Context-aware answers
|
|
107
|
+
* Navigation help inside apps
|
|
108
|
+
* Reduced support workload
|
|
29
109
|
|
|
30
|
-
|
|
110
|
+
Instead of users leaving confused, your website can guide them automatically.
|
|
31
111
|
|
|
32
|
-
|
|
112
|
+
---
|
|
33
113
|
|
|
34
|
-
|
|
114
|
+
## License
|
|
35
115
|
|
|
36
|
-
|
|
116
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -60,7 +60,6 @@ var import_react = require("react");
|
|
|
60
60
|
var import_axios = __toESM(require("axios"));
|
|
61
61
|
|
|
62
62
|
// lib/config.ts
|
|
63
|
-
var DEFAULT_API_BASE_URL = "http://localhost:8080/api";
|
|
64
63
|
function getApiBaseUrl() {
|
|
65
64
|
return process.env.NEXT_PUBLIC_CONTENIFY_API_URL || DEFAULT_API_BASE_URL;
|
|
66
65
|
}
|