@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.
Files changed (2) hide show
  1. package/README.md +56 -45
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,11 +2,13 @@
2
2
 
3
3
  [![Accessibility](https://img.shields.io/badge/accessibility-WCAG%202.1%20AA-green)](./documentation/accessibility/compliance.md)
4
4
 
5
- A lightweight TypeScript SDK for adding an AI-powered user engagement engine by Deway to your web app.
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
- Copy and paste this prompt to your AI coding assistant (Claude, Copilot, etc.) to get Deway set up with best practices:
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 a user
65
+ // Identify users for personalized experiences
62
66
  Deway.identify('user-123');
63
67
  ```
64
68
 
65
- **Note:** While methods can be called immediately (they're queued until initialization completes), best practice is to call `Deway.init()` early in your app lifecycle.
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
- **Note:** Most configuration options (themes, feature flags, prompts, etc.) are managed remotely and automatically fetched during initialization. Only the fields above are configurable by SDK callers.
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
- Initialize the SDK with configuration options. Should be called early in your app lifecycle (commands are queued until initialization completes).
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
- Associate a user ID with the current session for personalized experiences.
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
- Report a custom event with the given name and parameters.
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
- Set or update the user profile for the currently identified user.
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
- Show the AI chat interface. Optional configuration:
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 corner
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
- Hide the AI chat interface.
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 opens the chat interface. This is equivalent to the user clicking the entrypoint widget (bubble or bookmark).
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
- // Identify user when available
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
- ## Features
264
+ ## What You Get
257
265
 
258
- - **AI-powered user engagement and assistance**: Interactive chat interface for user support
259
- - **Automatic user behavior analysis**: Intelligent tracking and understanding of user interactions
260
- - **Remote configuration management**: Feature flags, themes, and prompts managed remotely
261
- - **Dual appearance modes**: Edge-pinned bookmark or floating bubble display
262
- - **Framework-agnostic integration**: Works with React, Vue, Angular, and vanilla JavaScript
263
- - **Full TypeScript support**: Complete type definitions included
264
- - **Lightweight loader**: ~5KB loader shell with dynamic backend loading
265
- - **Offline resilience**: Backend bundle cached locally for faster loads
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
- ## Edge Cases & Internal Behavior
275
+ ## How Deway Adapts for You
268
276
 
269
- ### Error Handling
277
+ ### Graceful Error Handling
270
278
 
271
- The SDK handles all errors internally. Callers don't need try-catch blocks around SDK methods. Failed operations are logged to the console and retried automatically when appropriate.
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
- ### State Persistence
281
+ ### Persistent User Context
274
282
 
275
- User identification and settings persist across page reloads via localStorage. Once a user is identified, they remain identified until `Deway.destroy()` is called or localStorage is cleared.
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
- ### Multiple init() Calls
285
+ ### Idempotent Initialization
278
286
 
279
- Calling `Deway.init()` multiple times is safe. Subsequent calls after the first are ignored.
287
+ Multiple `Deway.init()` calls are safe and ignored after the first. The SDK adapts to your initialization patterns without breaking.
280
288
 
281
- ### Automatic Retries
289
+ ### Smart Retry Logic
282
290
 
283
- Failed API calls and uploads are automatically retried with exponential backoff. No manual intervention is required.
291
+ Failed network operations automatically retry with exponential backoff. The SDK handles connectivity issues gracefully—no manual intervention required.
284
292
 
285
- ### Command Queue
293
+ ### Intelligent Command Queuing
286
294
 
287
- All SDK methods can be called immediately, even before initialization completes. The loader queues commands and executes them automatically once the backend bundle loads and `Deway.init()` completes.
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
- - Verify `Deway.init()` was called with valid `appKey`
294
- - Check if auto-show is enabled in your remote configuration, or manually call `Deway.show()`
295
- - Check browser console for initialization errors
296
- - Verify the SDK completed initialization with `Deway.isInitialized()`
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
- - Ensure `Deway.init()` is called before `Deway.identify()`
301
- - User ID must be a non-empty string
302
- - Check browser console for error logs
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
- - The SDK queues commands called before initialization
307
- - Commands execute automatically once `Deway.init()` completes
308
- - Check browser console for errors during initialization
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deway-ai/web-sdk",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "type": "module",
5
5
  "description": "Deway's Web SDK",
6
6
  "main": "dist/loader.umd.js",