humanbehavior-js 0.0.1 → 0.0.3
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/dist/cjs/index.js +7 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -4098,7 +4098,7 @@ function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {
|
|
|
4098
4098
|
return buf;
|
|
4099
4099
|
}
|
|
4100
4100
|
|
|
4101
|
-
var INGESTION_URL = process.env.HUMAN_BEHAVIOR_INGESTION_URL
|
|
4101
|
+
var INGESTION_URL = process.env.HUMAN_BEHAVIOR_INGESTION_URL; // for development
|
|
4102
4102
|
var MAX_CHUNK_SIZE_BYTES = 1024 * 1024 * 10; // 10MB chunk size
|
|
4103
4103
|
function isChunkSizeExceeded(currentChunk, newEvent, sessionId) {
|
|
4104
4104
|
var nextChunkSize = new TextEncoder().encode(JSON.stringify({
|
|
@@ -4120,6 +4120,9 @@ var HumanBehaviorAPI = /** @class */ (function () {
|
|
|
4120
4120
|
function HumanBehaviorAPI(_a) {
|
|
4121
4121
|
var apiKey = _a.apiKey;
|
|
4122
4122
|
this.apiKey = apiKey;
|
|
4123
|
+
if (!INGESTION_URL) {
|
|
4124
|
+
throw new Error('HUMAN_BEHAVIOR_INGESTION_URL is not set');
|
|
4125
|
+
}
|
|
4123
4126
|
this.baseUrl = INGESTION_URL;
|
|
4124
4127
|
}
|
|
4125
4128
|
HumanBehaviorAPI.prototype.init = function (sessionId, userId) {
|
|
@@ -4484,6 +4487,9 @@ var HumanBehaviorTracker = /** @class */ (function () {
|
|
|
4484
4487
|
this.endUserId = null;
|
|
4485
4488
|
this.initialized = false;
|
|
4486
4489
|
this.initializationPromise = null;
|
|
4490
|
+
if (!apiKey) {
|
|
4491
|
+
throw new Error('Human Behavior apiKey is required');
|
|
4492
|
+
}
|
|
4487
4493
|
this.api = new HumanBehaviorAPI({
|
|
4488
4494
|
apiKey: apiKey,
|
|
4489
4495
|
});
|