@veridia/node-sdk 1.0.9 → 1.0.11
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 +2 -2
- package/dist/cjs/client.js +4 -6
- package/dist/cjs/http.js +1 -34
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client.js +2 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Veridia Node SDK
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@veridia/node-sdk)
|
|
4
|
-
|
|
5
3
|
Official Node.js SDK for integrating with the [Veridia Platform](https://veridia.io).
|
|
6
4
|
It provides an easy way to identify users, send tracking events, retrieve user segments, and manage batching with retries and timeouts — all from your backend.
|
|
7
5
|
|
|
6
|
+
[](https://www.npmjs.com/package/@veridia/node-sdk)
|
|
7
|
+
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## 🚀 Installation
|
package/dist/cjs/client.js
CHANGED
|
@@ -49,8 +49,8 @@ class VeridiaClient {
|
|
|
49
49
|
this.maxBufferTimeMs = options.maxBufferTimeMs ?? 5000;
|
|
50
50
|
this.retries = options.retries ?? 3;
|
|
51
51
|
this.retryBaseDelayMs = options.retryBaseDelayMs ?? 500;
|
|
52
|
-
this.timeoutMsGetUserSegments = options.timeoutMsGetUserSegments ??
|
|
53
|
-
this.timeoutMsFlush = options.timeoutMsFlush ??
|
|
52
|
+
this.timeoutMsGetUserSegments = options.timeoutMsGetUserSegments ?? 5000;
|
|
53
|
+
this.timeoutMsFlush = options.timeoutMsFlush ?? 30000;
|
|
54
54
|
this.logger = options.logger;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -158,10 +158,8 @@ class VeridiaClient {
|
|
|
158
158
|
clearTimeout(this.flushTimer);
|
|
159
159
|
this.flushTimer = undefined;
|
|
160
160
|
}
|
|
161
|
-
await
|
|
162
|
-
|
|
163
|
-
this.flushBatch('events', this.trackBuffer),
|
|
164
|
-
]);
|
|
161
|
+
await this.flushBatch('profiles', this.identifyBuffer);
|
|
162
|
+
await this.flushBatch('events', this.trackBuffer);
|
|
165
163
|
}
|
|
166
164
|
/**
|
|
167
165
|
* Flushes all pending data and prepares the client for shutdown.
|
package/dist/cjs/http.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.httpFetch = httpFetch;
|
|
37
4
|
let _fetch;
|
|
@@ -42,7 +9,7 @@ async function getFetch() {
|
|
|
42
9
|
_fetch = globalThis.fetch.bind(globalThis);
|
|
43
10
|
}
|
|
44
11
|
else {
|
|
45
|
-
const mod = await
|
|
12
|
+
const mod = await import('node-fetch');
|
|
46
13
|
_fetch = (mod.default ?? mod);
|
|
47
14
|
}
|
|
48
15
|
return _fetch;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.11";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/client.js
CHANGED
|
@@ -158,10 +158,8 @@ class VeridiaClient {
|
|
|
158
158
|
clearTimeout(this.flushTimer);
|
|
159
159
|
this.flushTimer = undefined;
|
|
160
160
|
}
|
|
161
|
-
await
|
|
162
|
-
|
|
163
|
-
this.flushBatch('events', this.trackBuffer),
|
|
164
|
-
]);
|
|
161
|
+
await this.flushBatch('profiles', this.identifyBuffer);
|
|
162
|
+
await this.flushBatch('events', this.trackBuffer);
|
|
165
163
|
}
|
|
166
164
|
/**
|
|
167
165
|
* Flushes all pending data and prepares the client for shutdown.
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.11";
|
package/dist/esm/version.js
CHANGED