obi-sdk 0.1.8 → 0.1.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 +0 -65
- package/dist/{index-d9a81606.js → index-719ec57d.js} +792 -889
- package/dist/modular/chunks/{obi-widget-0d63936f.js → obi-widget-ff350828.js} +4 -4
- package/dist/modular/chunks/{obi-widget-0d63936f.js.map → obi-widget-ff350828.js.map} +1 -1
- package/dist/modular/chunks/{session-88fd0dca.js → session-c3b70ffb.js} +2 -2
- package/dist/modular/chunks/{session-88fd0dca.js.map → session-c3b70ffb.js.map} +1 -1
- package/dist/modular/core.js +5 -5
- package/dist/modular/index.js +220 -130
- package/dist/modular/index.js.map +1 -1
- package/dist/modular/ui.js +11 -11
- package/dist/obi-loader.js +5 -83
- package/dist/obi-sdk.es.js +5 -6
- package/dist/obi-sdk.standalone.iife.js +15 -15
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/obi-sdk.umd.js +41 -41
- package/dist/{session-c2549ff3.js → session-730ff76c.js} +1 -1
- package/package.json +2 -2
- package/dist/modular/chunks/assistant-5a47c1b4.js +0 -234
- package/dist/modular/chunks/assistant-5a47c1b4.js.map +0 -1
- package/dist/obi-loader.iife.js +0 -2
- package/dist/obi-loader.iife.js.map +0 -1
- package/dist/obi-loader.js.map +0 -1
- package/dist/obi-loader.umd.cjs +0 -2
- package/dist/obi-loader.umd.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -76,48 +76,6 @@ You can also include the loader directly from our CDN:
|
|
|
76
76
|
<script src="https://unpkg.com/obi-sdk@latest/dist/obi-loader.iife.js"></script>
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
### Installation for npm Projects
|
|
80
|
-
|
|
81
|
-
You can also install the SDK via npm:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npm install obi-sdk
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Always Load the Latest SDK Version
|
|
88
|
-
|
|
89
|
-
The SDK includes a simple function to always load the latest version from the CDN, which can be useful for applications that need to ensure users always have the newest features:
|
|
90
|
-
|
|
91
|
-
```tsx
|
|
92
|
-
import { initObi } from "obi-sdk"
|
|
93
|
-
|
|
94
|
-
// In a React component:
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
const setupObi = async () => {
|
|
97
|
-
try {
|
|
98
|
-
// This will:
|
|
99
|
-
// 1. Check npm registry for the latest version
|
|
100
|
-
// 2. Load that specific version from unpkg.com
|
|
101
|
-
// 3. Initialize the widget with your config
|
|
102
|
-
await initObi({
|
|
103
|
-
apiKey: "YOUR_API_KEY",
|
|
104
|
-
position: "bottom-right",
|
|
105
|
-
user: {
|
|
106
|
-
id: "user-123",
|
|
107
|
-
email: "user@example.com",
|
|
108
|
-
},
|
|
109
|
-
})
|
|
110
|
-
console.log("Obi Assistant initialized with latest SDK")
|
|
111
|
-
} catch (error) {
|
|
112
|
-
console.error("Failed to initialize Obi Assistant:", error)
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Initialize Obi
|
|
117
|
-
setupObi()
|
|
118
|
-
}, [])
|
|
119
|
-
```
|
|
120
|
-
|
|
121
79
|
## Widget Positioning
|
|
122
80
|
|
|
123
81
|
The widget can be positioned in one of four corners of the page:
|
|
@@ -129,29 +87,6 @@ window.obiWidgetConfig = {
|
|
|
129
87
|
}
|
|
130
88
|
```
|
|
131
89
|
|
|
132
|
-
### Theming
|
|
133
|
-
|
|
134
|
-
The widget supports light and dark themes:
|
|
135
|
-
|
|
136
|
-
```js
|
|
137
|
-
window.obiWidgetConfig = {
|
|
138
|
-
theme: "light", // Options: "light", "dark"
|
|
139
|
-
apiKey: "YOUR_API_KEY",
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### SDK Version Control
|
|
144
|
-
|
|
145
|
-
You can specify which version of the SDK to load:
|
|
146
|
-
|
|
147
|
-
```js
|
|
148
|
-
window.obiWidgetConfig = {
|
|
149
|
-
sdkVersion: "latest", // Use "latest" or a specific version number
|
|
150
|
-
noCacheSDK: false, // Set to true to bypass cache
|
|
151
|
-
apiKey: "YOUR_API_KEY",
|
|
152
|
-
}
|
|
153
|
-
```
|
|
154
|
-
|
|
155
90
|
## License
|
|
156
91
|
|
|
157
92
|
SEE LICENSE IN LICENSE.txt
|