@emblemvault/hustle-react 1.4.7 → 1.4.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 +52 -34
- package/dist/browser/hustle-react.js +5 -5
- package/dist/browser/hustle-react.js.map +1 -1
- package/dist/components/index.cjs +5 -5
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +5 -5
- package/dist/components/index.js.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,9 @@ npm install @emblemvault/hustle-react
|
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Web Application (Recommended)
|
|
14
|
+
|
|
15
|
+
Use the React component with Emblem Auth for a complete authentication experience:
|
|
14
16
|
|
|
15
17
|
```tsx
|
|
16
18
|
import { EmblemAuthProvider, ConnectButton } from '@emblemvault/emblem-auth-react';
|
|
@@ -28,7 +30,9 @@ function App() {
|
|
|
28
30
|
}
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
### With API Key (
|
|
33
|
+
### With API Key (Deprecated)
|
|
34
|
+
|
|
35
|
+
> ⚠️ **Deprecated:** API key authentication is deprecated and will be removed in a future version. Please migrate to the Emblem Auth React component for better security and user experience.
|
|
32
36
|
|
|
33
37
|
```tsx
|
|
34
38
|
import { HustleProvider, HustleChat } from '@emblemvault/hustle-react';
|
|
@@ -50,13 +54,9 @@ Provides chat context to your app.
|
|
|
50
54
|
|
|
51
55
|
```tsx
|
|
52
56
|
<HustleProvider
|
|
53
|
-
// With
|
|
57
|
+
// With EmblemAuthProvider (recommended) - uses authentication context
|
|
54
58
|
hustleApiUrl="https://agenthustle.ai" // optional
|
|
55
59
|
|
|
56
|
-
// OR with API key (standalone)
|
|
57
|
-
apiKey="your-key"
|
|
58
|
-
vaultId="your-vault"
|
|
59
|
-
|
|
60
60
|
// Multi-instance support
|
|
61
61
|
instanceId="unique-id" // Scopes settings per instance
|
|
62
62
|
>
|
|
@@ -64,6 +64,12 @@ Provides chat context to your app.
|
|
|
64
64
|
</HustleProvider>
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
**Props:**
|
|
68
|
+
- `hustleApiUrl` (optional) - Hustle API endpoint URL. Defaults to `https://agenthustle.ai`
|
|
69
|
+
- `instanceId` (optional) - Unique identifier for multi-instance setups. Scopes settings and plugins per instance.
|
|
70
|
+
- ~~`apiKey`~~ (deprecated) - API key for standalone auth. **Deprecated:** Use `EmblemAuthProvider` instead.
|
|
71
|
+
- ~~`vaultId`~~ (deprecated) - Vault ID for standalone auth. **Deprecated:** Use `EmblemAuthProvider` instead.
|
|
72
|
+
|
|
67
73
|
### useHustle
|
|
68
74
|
|
|
69
75
|
Access chat state and methods.
|
|
@@ -116,6 +122,7 @@ Complete chat UI component.
|
|
|
116
122
|
Floating chat widget for site-wide chatbot integration. Perfect for customer support or AI assistants that persist across page navigations.
|
|
117
123
|
|
|
118
124
|
```tsx
|
|
125
|
+
import { EmblemAuthProvider } from '@emblemvault/emblem-auth-react';
|
|
119
126
|
import { HustleProvider, HustleChatWidget } from '@emblemvault/hustle-react';
|
|
120
127
|
|
|
121
128
|
// Add to your Next.js layout for site-wide availability
|
|
@@ -123,25 +130,27 @@ export default function RootLayout({ children }) {
|
|
|
123
130
|
return (
|
|
124
131
|
<html>
|
|
125
132
|
<body>
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
<EmblemAuthProvider appId="your-app-id">
|
|
134
|
+
<HustleProvider>
|
|
135
|
+
{children}
|
|
136
|
+
<HustleChatWidget
|
|
137
|
+
config={{
|
|
138
|
+
position: 'bottom-right', // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
|
|
139
|
+
size: 'md', // 'sm' | 'md' | 'lg' | 'xl' | 'full'
|
|
140
|
+
title: 'Support', // Header title
|
|
141
|
+
defaultOpen: false, // Start open?
|
|
142
|
+
offset: { x: 24, y: 24 }, // Edge offset in pixels
|
|
143
|
+
storageKey: 'chat-open', // localStorage key for persistence (false to disable)
|
|
144
|
+
showBadge: true, // Show notification badge
|
|
145
|
+
badgeContent: 3, // Badge content
|
|
146
|
+
onOpen: () => {}, // Called when widget opens
|
|
147
|
+
onClose: () => {}, // Called when widget closes
|
|
148
|
+
}}
|
|
149
|
+
placeholder="How can we help?"
|
|
150
|
+
showSettings
|
|
151
|
+
/>
|
|
152
|
+
</HustleProvider>
|
|
153
|
+
</EmblemAuthProvider>
|
|
145
154
|
</body>
|
|
146
155
|
</html>
|
|
147
156
|
);
|
|
@@ -251,19 +260,28 @@ const plugin: HustlePlugin = {
|
|
|
251
260
|
|
|
252
261
|
## Multi-Instance Support
|
|
253
262
|
|
|
254
|
-
Run multiple isolated chat instances:
|
|
263
|
+
Run multiple isolated chat instances with separate settings and plugins:
|
|
255
264
|
|
|
256
265
|
```tsx
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
</HustleProvider>
|
|
266
|
+
import { EmblemAuthProvider } from '@emblemvault/emblem-auth-react';
|
|
267
|
+
import { HustleProvider, HustleChat } from '@emblemvault/hustle-react';
|
|
260
268
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
269
|
+
function App() {
|
|
270
|
+
return (
|
|
271
|
+
<EmblemAuthProvider appId="your-app-id">
|
|
272
|
+
<HustleProvider instanceId="trading-bot">
|
|
273
|
+
<HustleChat />
|
|
274
|
+
</HustleProvider>
|
|
275
|
+
|
|
276
|
+
<HustleProvider instanceId="support-bot">
|
|
277
|
+
<HustleChat />
|
|
278
|
+
</HustleProvider>
|
|
279
|
+
</EmblemAuthProvider>
|
|
280
|
+
);
|
|
281
|
+
}
|
|
264
282
|
```
|
|
265
283
|
|
|
266
|
-
Each instance has separate settings and plugins stored under its
|
|
284
|
+
Each instance has separate settings and plugins stored under its unique `instanceId`.
|
|
267
285
|
|
|
268
286
|
## Underlying SDK
|
|
269
287
|
|
|
@@ -15840,13 +15840,13 @@ var widgetStyles = {
|
|
|
15840
15840
|
width: "56px",
|
|
15841
15841
|
height: "56px",
|
|
15842
15842
|
borderRadius: tokens.radius.full,
|
|
15843
|
-
background:
|
|
15844
|
-
border: "
|
|
15843
|
+
background: "rgba(255, 255, 255, 0.05)",
|
|
15844
|
+
border: "1px solid rgba(255, 255, 255, 0.1)",
|
|
15845
15845
|
cursor: "pointer",
|
|
15846
15846
|
display: "flex",
|
|
15847
15847
|
alignItems: "center",
|
|
15848
15848
|
justifyContent: "center",
|
|
15849
|
-
boxShadow:
|
|
15849
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.05)",
|
|
15850
15850
|
transition: `all ${tokens.transitions.normal}`,
|
|
15851
15851
|
color: tokens.colors.textInverse
|
|
15852
15852
|
},
|
|
@@ -15854,8 +15854,8 @@ var widgetStyles = {
|
|
|
15854
15854
|
boxShadow: `0 4px 20px rgba(76, 154, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3)`
|
|
15855
15855
|
},
|
|
15856
15856
|
launcherHover: {
|
|
15857
|
-
|
|
15858
|
-
|
|
15857
|
+
background: "rgba(255, 255, 255, 0.08)",
|
|
15858
|
+
borderColor: "rgba(255, 255, 255, 0.15)"
|
|
15859
15859
|
},
|
|
15860
15860
|
launcherGlowHover: {
|
|
15861
15861
|
boxShadow: `0 6px 24px rgba(76, 154, 255, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4)`
|