@deway-ai/web-sdk 0.52.0 → 0.53.0
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 +56 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[](./documentation/accessibility/compliance.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Software should adapt to users — not the other way around.**
|
|
6
|
+
|
|
7
|
+
Deway is your AI assistant that learns your product, embedding proactive guidance directly into your web app. Scale expert knowledge across your entire user base with real-time, intelligent assistance that continuously improves with every interaction.
|
|
6
8
|
|
|
7
9
|
## Quick Install with AI Assistant
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
Let AI help AI. Copy this prompt to your coding assistant (Claude, Copilot, etc.) to get Deway integrated with best practices for your specific framework:
|
|
10
12
|
|
|
11
13
|
```text
|
|
12
14
|
Install and integrate the Deway Web SDK (@deway-ai/web-sdk) into my project.
|
|
@@ -38,6 +40,8 @@ FIRST analyze my project structure and detect the framework and package manager.
|
|
|
38
40
|
|
|
39
41
|
## Installation
|
|
40
42
|
|
|
43
|
+
Add Deway to your project with your preferred package manager:
|
|
44
|
+
|
|
41
45
|
```bash
|
|
42
46
|
npm install @deway-ai/web-sdk
|
|
43
47
|
# or
|
|
@@ -58,11 +62,11 @@ Deway.init({
|
|
|
58
62
|
appKey: 'your-app-key'
|
|
59
63
|
});
|
|
60
64
|
|
|
61
|
-
// Identify
|
|
65
|
+
// Identify users for personalized experiences
|
|
62
66
|
Deway.identify('user-123');
|
|
63
67
|
```
|
|
64
68
|
|
|
65
|
-
**Note:**
|
|
69
|
+
**Note:** Methods can be called immediately and are queued until initialization completes. For best results, call `Deway.init()` early in your app lifecycle to start learning user patterns from the first interaction.
|
|
66
70
|
|
|
67
71
|
### HTML/JavaScript Integration
|
|
68
72
|
|
|
@@ -80,27 +84,29 @@ Deway.identify('user-123');
|
|
|
80
84
|
|
|
81
85
|
## Configuration
|
|
82
86
|
|
|
87
|
+
Deway keeps configuration simple—just provide your app key and we handle the rest:
|
|
88
|
+
|
|
83
89
|
```typescript
|
|
84
90
|
Deway.init({
|
|
85
91
|
appKey: string, // Required: Your Deway app key
|
|
86
92
|
});
|
|
87
93
|
```
|
|
88
94
|
|
|
89
|
-
**
|
|
95
|
+
**Why so simple?** Themes, feature flags, AI prompts, and behavior settings are managed remotely and adapt automatically. This lets you iterate on user experiences without SDK updates or app deployments.
|
|
90
96
|
|
|
91
97
|
## API Reference
|
|
92
98
|
|
|
93
99
|
### `Deway.init(config)`
|
|
94
100
|
|
|
95
|
-
|
|
101
|
+
Start learning your product and embedding intelligent guidance into your app. Call this early in your app lifecycle to begin building user-specific insights (commands are queued until initialization completes).
|
|
96
102
|
|
|
97
103
|
### `Deway.identify(userId)`
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
Connect a user ID to enable personalized, context-aware assistance that adapts to their unique journey.
|
|
100
106
|
|
|
101
107
|
### `Deway.reportEvent(name, params)`
|
|
102
108
|
|
|
103
|
-
|
|
109
|
+
Track custom events to help Deway understand your product's unique workflows and provide smarter, context-aware guidance.
|
|
104
110
|
|
|
105
111
|
**Parameters:**
|
|
106
112
|
|
|
@@ -120,7 +126,7 @@ Deway.reportEvent('Product Purchased', {
|
|
|
120
126
|
|
|
121
127
|
### `Deway.setUserProfile(userProfile)`
|
|
122
128
|
|
|
123
|
-
|
|
129
|
+
Enrich user profiles to enable deeper personalization and more intelligent assistance tailored to each user's context.
|
|
124
130
|
|
|
125
131
|
**Parameters:**
|
|
126
132
|
|
|
@@ -147,7 +153,7 @@ Deway.setUserProfile({
|
|
|
147
153
|
|
|
148
154
|
### `Deway.show(config?)`
|
|
149
155
|
|
|
150
|
-
|
|
156
|
+
Display the AI assistant interface that adapts to your users' needs. Choose the appearance that fits your product best.
|
|
151
157
|
|
|
152
158
|
```typescript
|
|
153
159
|
interface EntrypointWidgetConfig {
|
|
@@ -156,16 +162,16 @@ interface EntrypointWidgetConfig {
|
|
|
156
162
|
```
|
|
157
163
|
|
|
158
164
|
**Appearance Modes:**
|
|
159
|
-
- `"bookmark"`: Edge-pinned vertical tab (default)
|
|
160
|
-
- `"bubble"`: Floating ellipsoid pill at bottom-right
|
|
165
|
+
- `"bookmark"`: Edge-pinned vertical tab for persistent, non-intrusive access (default)
|
|
166
|
+
- `"bubble"`: Floating ellipsoid pill at bottom-right for prominent visibility
|
|
161
167
|
|
|
162
168
|
### `Deway.hide()`
|
|
163
169
|
|
|
164
|
-
|
|
170
|
+
Temporarily hide the AI assistant interface while keeping the intelligent learning active in the background.
|
|
165
171
|
|
|
166
172
|
### `Deway.openChat()`
|
|
167
173
|
|
|
168
|
-
Programmatically
|
|
174
|
+
Programmatically open the chat interface to guide users exactly when they need assistance. Perfect for contextual help triggers.
|
|
169
175
|
|
|
170
176
|
**Example:**
|
|
171
177
|
|
|
@@ -196,6 +202,8 @@ Clean up SDK resources and stop all tracking.
|
|
|
196
202
|
|
|
197
203
|
## Framework Examples
|
|
198
204
|
|
|
205
|
+
Deway adapts seamlessly to your framework of choice. Here's how to integrate intelligent user assistance into popular frameworks:
|
|
206
|
+
|
|
199
207
|
### React
|
|
200
208
|
|
|
201
209
|
```tsx
|
|
@@ -208,7 +216,7 @@ function App() {
|
|
|
208
216
|
appKey: 'your-app-key'
|
|
209
217
|
});
|
|
210
218
|
|
|
211
|
-
//
|
|
219
|
+
// Enable personalized assistance when user is known
|
|
212
220
|
if (user?.id) {
|
|
213
221
|
Deway.identify(user.id);
|
|
214
222
|
}
|
|
@@ -253,56 +261,59 @@ export class AppComponent implements OnInit {
|
|
|
253
261
|
}
|
|
254
262
|
```
|
|
255
263
|
|
|
256
|
-
##
|
|
264
|
+
## What You Get
|
|
257
265
|
|
|
258
|
-
- **AI
|
|
259
|
-
- **
|
|
260
|
-
- **
|
|
261
|
-
- **
|
|
262
|
-
- **
|
|
263
|
-
- **
|
|
264
|
-
- **
|
|
265
|
-
- **
|
|
266
|
+
- **Proactive AI Guidance**: Intelligent assistance that learns your product and adapts to each user's journey
|
|
267
|
+
- **Real-time Issue Prevention**: Detect and resolve problems before users encounter them
|
|
268
|
+
- **Continuous Learning**: Self-improving knowledge graph that gets smarter with every interaction
|
|
269
|
+
- **Scaled Expert Knowledge**: Give every user the experience of having a dedicated specialist
|
|
270
|
+
- **Seamless Integration**: Works with React, Vue, Angular, and vanilla JavaScript
|
|
271
|
+
- **Zero Configuration Overhead**: Feature flags, themes, and AI prompts managed remotely
|
|
272
|
+
- **Performance First**: ~5KB loader with dynamic backend loading and offline resilience
|
|
273
|
+
- **Full TypeScript Support**: Complete type definitions for a superior developer experience
|
|
266
274
|
|
|
267
|
-
##
|
|
275
|
+
## How Deway Adapts for You
|
|
268
276
|
|
|
269
|
-
### Error Handling
|
|
277
|
+
### Graceful Error Handling
|
|
270
278
|
|
|
271
|
-
The SDK handles all errors internally
|
|
279
|
+
The SDK handles all errors internally with intelligent recovery. No try-catch blocks needed—failed operations are logged and retried automatically so your app stays resilient.
|
|
272
280
|
|
|
273
|
-
###
|
|
281
|
+
### Persistent User Context
|
|
274
282
|
|
|
275
|
-
User identification and
|
|
283
|
+
User identification and preferences persist across sessions via localStorage. Once identified, users receive continuous personalized assistance until you explicitly call `Deway.destroy()` or clear storage.
|
|
276
284
|
|
|
277
|
-
###
|
|
285
|
+
### Idempotent Initialization
|
|
278
286
|
|
|
279
|
-
|
|
287
|
+
Multiple `Deway.init()` calls are safe and ignored after the first. The SDK adapts to your initialization patterns without breaking.
|
|
280
288
|
|
|
281
|
-
###
|
|
289
|
+
### Smart Retry Logic
|
|
282
290
|
|
|
283
|
-
Failed
|
|
291
|
+
Failed network operations automatically retry with exponential backoff. The SDK handles connectivity issues gracefully—no manual intervention required.
|
|
284
292
|
|
|
285
|
-
### Command
|
|
293
|
+
### Intelligent Command Queuing
|
|
286
294
|
|
|
287
|
-
|
|
295
|
+
Call SDK methods immediately without waiting for initialization. Commands queue automatically and execute once the backend loads—your code stays simple while Deway handles the complexity.
|
|
288
296
|
|
|
289
297
|
## Troubleshooting
|
|
290
298
|
|
|
291
299
|
### Interface doesn't appear
|
|
292
300
|
|
|
293
|
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
301
|
+
Deway adapts its visibility to your configuration. Check these common solutions:
|
|
302
|
+
- Verify `Deway.init()` was called with a valid `appKey`
|
|
303
|
+
- Enable auto-show in your remote configuration, or call `Deway.show()` manually
|
|
304
|
+
- Confirm initialization completed using `Deway.isInitialized()`
|
|
305
|
+
- Check browser console for initialization errors—the SDK logs helpful guidance
|
|
297
306
|
|
|
298
307
|
### User identification not working
|
|
299
308
|
|
|
300
|
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
309
|
+
For personalized experiences to activate:
|
|
310
|
+
- Call `Deway.init()` before `Deway.identify()`—initialization must complete first
|
|
311
|
+
- Ensure user ID is a non-empty string
|
|
312
|
+
- Check browser console for diagnostic logs—Deway provides clear error messages
|
|
303
313
|
|
|
304
314
|
### Commands not executing
|
|
305
315
|
|
|
306
|
-
|
|
307
|
-
- Commands execute
|
|
308
|
-
- Check
|
|
316
|
+
Deway's intelligent command queue handles this automatically:
|
|
317
|
+
- Commands called before initialization are queued and execute once ready
|
|
318
|
+
- Check `Deway.isInitialized()` to confirm the SDK is ready
|
|
319
|
+
- Review browser console for any initialization errors—Deway adapts and retries when possible
|