obi-sdk 0.3.12 → 0.4.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 +25 -0
- package/dist/loader.d.ts +5 -2
- package/dist/modular/chunks/{obi-widget-dffef845.js → obi-widget-9ef6796a.js} +992 -159
- package/dist/modular/chunks/obi-widget-9ef6796a.js.map +1 -0
- package/dist/modular/index.js +1 -1
- package/dist/modular/ui.js +10 -10
- package/dist/obi-sdk.es.js +991 -158
- package/dist/obi-sdk.es.js.map +1 -1
- package/dist/obi-sdk.standalone.iife.js +203 -54
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/obi-sdk.umd.js +195 -46
- package/dist/obi-sdk.umd.js.map +1 -1
- package/dist/ui/components/audio-equalizer.d.ts +1 -0
- package/dist/ui/components/courses/course-modal.d.ts +0 -2
- package/dist/ui/components/courses/courses.d.ts +1 -4
- package/dist/ui/components/obi-widget.d.ts +21 -1
- package/dist/ui/components/session-start-modal.d.ts +12 -0
- package/package.json +4 -2
- package/dist/modular/chunks/obi-widget-dffef845.js.map +0 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ The loader accepts the following configuration options:
|
|
|
21
21
|
| `apiKey` | string | - | Your Obi API key (required for production) |
|
|
22
22
|
| `user` | object | - | User information with `id` (required), `email` (optional) and `metadata` (optional) |
|
|
23
23
|
| `isActive` | boolean | `true` | Whether to show the widget. Set to `false` to disable the widget for specific users |
|
|
24
|
+
| `linkOnlyAccess` | boolean | `false` | Hide the widget unless accessed via a session link. Perfect for trial periods where only customers with direct links should see the widget |
|
|
24
25
|
| `primaryColor` | string | - | Custom primary color for the widget UI (CSS color value) |
|
|
25
26
|
| `secondaryColor` | string | - | Custom secondary color for the widget UI (CSS color value) |
|
|
26
27
|
|
|
@@ -41,6 +42,30 @@ window.obiWidgetConfig = {
|
|
|
41
42
|
}
|
|
42
43
|
```
|
|
43
44
|
|
|
45
|
+
## Trial Mode / Link-Only Access
|
|
46
|
+
|
|
47
|
+
The `linkOnlyAccess` option is perfect for trial periods where you want to control who can see and interact with the widget. When enabled, the widget remains hidden until a session is started via a direct link.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
window.obiWidgetConfig = {
|
|
51
|
+
apiKey: "YOUR_API_KEY",
|
|
52
|
+
linkOnlyAccess: true, // Widget only visible when accessed via session link
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This is ideal for:
|
|
57
|
+
|
|
58
|
+
- Trial periods where only specific customers should see the widget
|
|
59
|
+
- Beta testing with selected users
|
|
60
|
+
- Controlled rollouts using session-specific links
|
|
61
|
+
- Demo environments where widget access is link-based
|
|
62
|
+
|
|
63
|
+
When `linkOnlyAccess` is `true`:
|
|
64
|
+
|
|
65
|
+
- Widget is invisible to regular website visitors
|
|
66
|
+
- Widget becomes visible only when a session is started (e.g., via URL parameters)
|
|
67
|
+
- Once a session ends, the widget returns to hidden state
|
|
68
|
+
|
|
44
69
|
## Session Persistence
|
|
45
70
|
|
|
46
71
|
The SDK now supports session persistence across page reloads and navigation. If a user refreshes the page or navigates to another page on your site, the session with Obi will be automatically restored when they return, providing a seamless experience.
|
package/dist/loader.d.ts
CHANGED
|
@@ -10,9 +10,12 @@ interface ObiWidgetConfig {
|
|
|
10
10
|
user?: {
|
|
11
11
|
id: string;
|
|
12
12
|
email?: string;
|
|
13
|
-
metadata?: any
|
|
14
|
-
};
|
|
13
|
+
metadata?: Record<string, any>;
|
|
14
|
+
} | null;
|
|
15
15
|
isActive?: boolean;
|
|
16
|
+
linkOnlyAccess?: boolean;
|
|
17
|
+
primaryColor?: string;
|
|
18
|
+
secondaryColor?: string;
|
|
16
19
|
}
|
|
17
20
|
declare class ObiWidgetLoader {
|
|
18
21
|
private config;
|