@blumessage/react-chat 1.0.8 → 1.0.9
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 +7 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ function App() {
|
|
|
83
83
|
| `initialMessages` | `Message[]` | `[]` | Pre-populate with messages |
|
|
84
84
|
| `conversationId` | `string` | - | Continue specific conversation |
|
|
85
85
|
| `persistent` | `boolean` | `false` | Use localStorage vs sessionStorage |
|
|
86
|
-
| `showTimestamps` | `boolean` | `false` | Display timestamps: today="
|
|
86
|
+
| `showTimestamps` | `boolean` | `false` | Display timestamps: today="2:00 PM", older="17 July, 1:00 PM" |
|
|
87
87
|
| `typingText` | `string` | `"Agent is typing..."` | Custom text shown while waiting for assistant response |
|
|
88
88
|
| **Event Callbacks** |
|
|
89
89
|
| `onUserMessage` | `(message: Message) => void` | - | Called when user sends message |
|
|
@@ -162,20 +162,20 @@ const initialMessages = [
|
|
|
162
162
|
```tsx
|
|
163
163
|
<BlumessageChat
|
|
164
164
|
apiKey="your-api-key"
|
|
165
|
-
showTimestamps={true} // Shows "
|
|
165
|
+
showTimestamps={true} // Shows "2:00 PM" or "17 July, 1:00 PM"
|
|
166
166
|
floating={false}
|
|
167
167
|
initialMessages={[
|
|
168
168
|
{
|
|
169
169
|
id: '1',
|
|
170
170
|
role: 'assistant' as const,
|
|
171
171
|
content: 'Message from today',
|
|
172
|
-
timestamp: Date.now() - (60 * 60 * 1000) // Shows: "
|
|
172
|
+
timestamp: Date.now() - (60 * 60 * 1000) // Shows: "2:00 PM" (or "14:00")
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
id: '2',
|
|
176
176
|
role: 'user' as const,
|
|
177
177
|
content: 'Message from yesterday',
|
|
178
|
-
timestamp: Date.now() - (24 * 60 * 60 * 1000) // Shows: "17 July,
|
|
178
|
+
timestamp: Date.now() - (24 * 60 * 60 * 1000) // Shows: "17 July, 1:00 PM"
|
|
179
179
|
}
|
|
180
180
|
]}
|
|
181
181
|
/>
|
|
@@ -275,36 +275,6 @@ interface Message {
|
|
|
275
275
|
}
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
-
## API Integration
|
|
279
|
-
|
|
280
|
-
### Message Sending
|
|
281
|
-
```
|
|
282
|
-
POST https://api.blumessage.com/api/v1/conversations
|
|
283
|
-
Content-Type: application/json
|
|
284
|
-
Authorization: Bearer {API_KEY}
|
|
285
|
-
|
|
286
|
-
{
|
|
287
|
-
"message": "user input",
|
|
288
|
-
"conversationId": "optional-existing-id"
|
|
289
|
-
}
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### Conversation History
|
|
293
|
-
```
|
|
294
|
-
GET https://api.blumessage.com/api/v1/conversations/session/{conversationId}
|
|
295
|
-
Authorization: {API_KEY}
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### API Key Validation
|
|
299
|
-
```
|
|
300
|
-
POST https://api.blumessage.com/api/v1/api-keys/validate
|
|
301
|
-
Content-Type: application/json
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
"apiKey": "your-api-key"
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
278
|
## Storage Behavior
|
|
309
279
|
|
|
310
280
|
- **SessionStorage (default)**: Conversations persist until browser tab closes
|
|
@@ -324,4 +294,6 @@ ISC
|
|
|
324
294
|
|
|
325
295
|
## Support
|
|
326
296
|
|
|
327
|
-
For issues and feature requests, please visit the [GitHub repository](https://github.com/Blumessage/react-chat).
|
|
297
|
+
For issues and feature requests, please visit the [GitHub repository](https://github.com/Blumessage/react-chat).
|
|
298
|
+
|
|
299
|
+
For technical support and assistance, please contact us at: **contact@blumessage.com**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blumessage/react-chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "A React TypeScript chat widget component with floating button, theming, and Blumessage API integration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blumessage <contact@blumessage.com>",
|