@kadoa/node-sdk 0.19.4-beta.3 → 0.20.2
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 +8 -13
- package/dist/browser/index.global.js +9 -9
- package/dist/browser/index.global.js.map +1 -1
- package/dist/index.d.mts +3175 -1035
- package/dist/index.d.ts +3175 -1035
- package/dist/index.js +437 -362
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +434 -363
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -144,11 +144,8 @@ Monitor websites continuously and receive live updates when data changes.
|
|
|
144
144
|
**Setup:**
|
|
145
145
|
|
|
146
146
|
```typescript
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
apiKey: 'your-api-key',
|
|
150
|
-
enableRealtime: true
|
|
151
|
-
});
|
|
147
|
+
const client = new KadoaClient({ apiKey: 'your-api-key' });
|
|
148
|
+
const realtime = await client.connectRealtime();
|
|
152
149
|
|
|
153
150
|
// Verify connection
|
|
154
151
|
if (client.isRealtimeConnected()) {
|
|
@@ -176,7 +173,7 @@ const monitor = await client
|
|
|
176
173
|
await monitor.waitForReady();
|
|
177
174
|
|
|
178
175
|
// Handle updates
|
|
179
|
-
|
|
176
|
+
realtime.onEvent((event) => {
|
|
180
177
|
if (event.workflowId === monitor.workflowId) {
|
|
181
178
|
console.log('Update:', event.data);
|
|
182
179
|
}
|
|
@@ -185,8 +182,8 @@ client.realtime?.onEvent((event) => {
|
|
|
185
182
|
|
|
186
183
|
**Requirements:**
|
|
187
184
|
- API key (personal or team)
|
|
188
|
-
- `
|
|
189
|
-
- Notifications enabled for at least one channel (
|
|
185
|
+
- Call `await client.connectRealtime()` before subscribing to events
|
|
186
|
+
- Notifications enabled for at least one channel (Webhook, Email, or Slack)
|
|
190
187
|
|
|
191
188
|
**When to use:** Price tracking, inventory monitoring, live content updates.
|
|
192
189
|
|
|
@@ -321,13 +318,11 @@ const client = new KadoaClient({
|
|
|
321
318
|
Enable realtime notifications using an API key:
|
|
322
319
|
|
|
323
320
|
```typescript
|
|
324
|
-
const client = new KadoaClient({
|
|
325
|
-
|
|
326
|
-
enableRealtime: true
|
|
327
|
-
});
|
|
321
|
+
const client = new KadoaClient({ apiKey: 'your-api-key' });
|
|
322
|
+
const realtime = await client.connectRealtime();
|
|
328
323
|
|
|
329
324
|
// Listen to events
|
|
330
|
-
|
|
325
|
+
realtime.onEvent((event) => {
|
|
331
326
|
console.log('Event:', event);
|
|
332
327
|
});
|
|
333
328
|
|