@contenify/chatbot 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 CHANGED
@@ -1,36 +1,116 @@
1
- This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1
+ # @contenify/chatbot
2
2
 
3
- ## Getting Started
3
+ Contenify Chatbot is an embeddable AI assistant widget for websites and web applications.
4
4
 
5
- First, run the development server:
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 run dev
9
- # or
10
- yarn dev
11
- # or
12
- pnpm dev
13
- # or
14
- bun dev
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
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
93
+ ---
18
94
 
19
- You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
95
+ ## Requirements
20
96
 
21
- This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
97
+ * React 18+
98
+ * A running Contenify backend API server
22
99
 
23
- ## Learn More
100
+ ---
24
101
 
25
- To learn more about Next.js, take a look at the following resources:
102
+ ## What Contenify Provides
26
103
 
27
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
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
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
110
+ Instead of users leaving confused, your website can guide them automatically.
31
111
 
32
- ## Deploy on Vercel
112
+ ---
33
113
 
34
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
114
+ ## License
35
115
 
36
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
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
  }