Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bluedot-innovation/javascript-sdk

Package Overview
Dependencies
Maintainers
13
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bluedot-innovation/javascript-sdk - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

60

dist/javascript-sdk.cjs.development.js

@@ -249,2 +249,7 @@ 'use strict';

var reservedFieldNames = ['customername', 'carcolor', 'orderid', 'carplate', 'eventtype', 'carmodel', 'mobilenumber'];
if (fieldName.toLowerCase().startsWith('hs_')) {
return reservedFieldNames.includes(fieldName.slice(3).toLowerCase());
}
return reservedFieldNames.includes(fieldName.toLowerCase());

@@ -265,2 +270,7 @@ };

};
var validateNotDisplayedCustomField = function validateNotDisplayedCustomField(fieldName) {
if (fieldName.toLowerCase().startsWith('hs_')) {
errorFactory.throwValidationError('The hs_ prefix is reserved for fields that are displayed in Hello Screens. Use the setDisplayedCustomDataField method to set these values');
}
};
var validateIsBoolean = function validateIsBoolean(input, fieldName) {

@@ -376,2 +386,3 @@ if (!isBoolean(input)) {

validateHelloScreensCustomDataField(fieldName, fieldValue);
validateNotDisplayedCustomField(fieldName);
var customFields = privateStore(this).customFields;

@@ -389,2 +400,22 @@

function setDisplayedCustomDataField(fieldName, fieldValue) {
validateHelloScreensCustomDataField(fieldName, fieldValue);
var displayedCustomFields = privateStore(this).displayedCustomFields;
if (displayedCustomFields === undefined) {
displayedCustomFields = {};
privateStore(this).displayedCustomFields = displayedCustomFields;
}
var displayedCustomFieldsObject = displayedCustomFields;
if (fieldName.toLowerCase().startsWith('hs_')) {
displayedCustomFieldsObject["hs_" + fieldName.slice(3)] = fieldValue;
} else {
displayedCustomFieldsObject["hs_" + fieldName] = fieldValue;
}
return this;
}
function convertToDataObject() {

@@ -399,3 +430,4 @@ var _a = privateStore(this),

orderId = _a.orderId,
customFields = _a.customFields;
customFields = _a.customFields,
displayedCustomFields = _a.displayedCustomFields;

@@ -407,37 +439,34 @@ if (!orderId) {

var castedCustomFields = customFields;
var castedDisplayedCustomFields = displayedCustomFields;
var helloDataTemplate = tslib.__assign({}, castedCustomFields);
var helloDataTemplate = tslib.__assign(tslib.__assign({}, castedCustomFields), castedDisplayedCustomFields);
if (eventType) {
helloDataTemplate.eventType = eventType;
helloDataTemplate.hs_eventType = eventType;
}
if (mobileNumber) {
helloDataTemplate.mobileNumber = eventType;
if (orderId) {
helloDataTemplate.hs_orderId = orderId;
}
if (customerName) {
helloDataTemplate.customerName = customerName;
helloDataTemplate.hs_customerName = customerName;
}
if (mobileNumber) {
helloDataTemplate.mobileNumber = mobileNumber;
helloDataTemplate['hs_Mobile Number'] = mobileNumber;
}
if (carPlate) {
helloDataTemplate.carPlate = carPlate;
helloDataTemplate['hs_Car Plate'] = carPlate;
}
if (carModel) {
helloDataTemplate.carModel = carModel;
helloDataTemplate['hs_Car Model'] = carModel;
}
if (carColor) {
helloDataTemplate.carColor = carColor;
helloDataTemplate['hs_Car Color'] = carColor;
}
if (orderId) {
helloDataTemplate.orderId = orderId;
}
return helloDataTemplate;

@@ -463,3 +492,4 @@ }

setOrderId: setOrderId,
convertToDataObject: convertToDataObject
convertToDataObject: convertToDataObject,
setDisplayedCustomDataField: setDisplayedCustomDataField
};

@@ -466,0 +496,0 @@ }

@@ -1,2 +0,2 @@

"use strict";var t,e=require("tslib"),r=require("events"),o=require("uuid"),n=(t=require("axios"))&&"object"==typeof t&&"default"in t?t.default:t,i=function(){var t=new WeakMap;return function(e){return t.has(e)||t.set(e,{}),t.get(e)}},a=!1;function s(t,e,r){a&&(e&&r?t(e,r):t(e||r||new Error("Error logger called. See stack trace for details")))}var c=function(t,e){return s(console.error,t,e)},u=function(t,e){return s(console.warn,t,e)},l=function(t,e){return s(console.log,t,e)},d={ValidationError:"ValidationError",NetworkRetriesExceededError:"NetworkRetriesExceededError",UnexpectedServerError:"UnexpectedServerError",InvalidInputTypeError:"InvalidInputTypeError",RequiredValueMissingError:"RequiredValueMissingError",SdkNotInitializedError:"SdkNotInitializedError",ProjectIdNotFoundError:"ProjectIdNotFoundError",NotFoundError:"NotFoundError",InterruptedByResetError:"InterruptedByResetError",LocationAPINotAvailableError:"LocationAPINotAvailableError"},f={createError:function(t,e,r){var o=new Error(e);o.name=t;var n=o;return n.errorObject=r,u(e,n),n},throwInvalidInputTypeError:function(t,e){throw this.createError(d.InvalidInputTypeError,null!=t?t:"Invalid input type error",e)},throwNetworkRetriesExceededError:function(t,e){throw this.createError(d.NetworkRetriesExceededError,t?"Failed to communicate via network after "+t+" attempts":"Failed to communicate via network",e)},throwProjectIdNotFoundError:function(t,e){throw this.createError(d.ProjectIdNotFoundError,t?"Project with ID: "+t+" not found":"Project ID not found",e)},throwRequiredValueMissingError:function(t,e){throw this.createError(d.RequiredValueMissingError,t?"Cannot trigger event. Missing required value: "+t:"Cannot trigger event. Missing required value",e)},throwSdkNotInitializedError:function(t,e){throw this.createError(d.SdkNotInitializedError,null!=t?t:"SDK is not initialized with a valid projectId",e)},throwUnexpectedServerError:function(t,e){throw this.createError(d.UnexpectedServerError,null!=t?t:"An unexpected server error occurred. Check the attached errorObject for more details",e)},throwValidationError:function(t,e){throw this.createError(d.ValidationError,null!=t?t:"Invalid input was detected",e)},throwNotFoundError:function(t,e){throw this.createError(d.NotFoundError,null!=t?t:"Not found",e)},throwInterruptedByResetError:function(t,e){throw this.createError(d.InterruptedByResetError,null!=t?t:"Interrupted by reset",e)},throwLocationAPINotAvailableError:function(t,e){throw this.createError(d.LocationAPINotAvailableError,null!=t?t:"Location API is not available",e)}},h=new r.EventEmitter,g={remoteConfig:e.__assign({},{oneShot:{minAccuracy:50,targetAccuracy:20,maxAttempts:15,timeout:5e3}}),globalConfigUrl:"https://globalconfig.bluedot.io/",globalConfig:null,isInitialized:!1,initializeStatus:"notStarted",projectId:null,reset:m,addListener:w,removeListener:E,id:0,locationEnabled:!1,userPersistenceEnabled:!1},v=1,p=new Proxy(e.__assign({},g),{get:function(t,e){return t[e]},set:function(t,e,r){return t[e]=r,h.emit("stateUpdated",e),!0}});function m(){return Object.assign(p,g),p.reset=m,p.addListener=w,p.removeListener=E,p.id=v++,h.emit("stateReset"),h.removeAllListeners(),p}function w(t){return l("Adding state listener"),h.on("stateUpdated",t)}function E(t){h.removeListener("stateUpdated",t)}m();var b=function(t){return"string"==typeof t},y=function(t){return"number"==typeof t&&t>0},I=function(t,e){b(t)||f.throwInvalidInputTypeError(e+" must be a string")},_=function(t,e){(function(t){return"boolean"==typeof t})(t)||f.throwInvalidInputTypeError(e+" must be a boolean")},S=i();function C(t){return I(t,"orderId"),S(this).orderId=t,this}function N(t){return I(t,"carModel"),S(this).carModel=t,this}function R(t){return I(t,"carPlate"),S(this).carPlate=t,this}function A(t){return I(t,"orderId"),S(this).carColor=t,this}function L(t){var e=function(t){var e;"string"==typeof t?e=t:"number"==typeof t&&(e=t.toString()),e||f.throwInvalidInputTypeError("mobileNumber must be a string");var r,o,n=e.replace(/ /g,"").replace(/-/g,"");return r=n,o=new RegExp(/^\+?[0-9]+$/),"string"==typeof r&&o.test(r)||f.throwValidationError("Invalid mobileNumber found. mobileNumber can only contain numerals or a leading + character"),n}(t);return S(this).mobileNumber=e,this}function P(t){return function(t){return!!b(t)&&["arrival","onTheWay"].includes(t)}(t)||f.throwValidationError("Invalid eventType found. eventType can only be 'arrival' or 'onTheWay'"),S(this).eventType=t,this}function U(t){return I(t,"customerName"),S(this).customerName=t,this}function j(t,e){!function(t,e){I(t,"fieldName"),I(e,"fieldValue"),function(t){return["customername","carcolor","orderid","carplate","eventtype","carmodel","mobilenumber"].includes(t.toLowerCase())}(t)&&f.throwValidationError(t+" is a reserved keyword for Hello Screens. Use the helloModel method instead to set this value")}(t,e);var r=S(this).customFields;return void 0===r&&(r={},S(this).customFields=r),r[t]=e,this}function T(){var t=S(this),r=t.eventType,o=t.mobileNumber,n=t.customerName,i=t.carModel,a=t.carColor,s=t.carPlate,c=t.orderId,u=t.customFields;c||f.throwRequiredValueMissingError("orderId");var l=e.__assign({},u);return r&&(l.eventType=r),o&&(l.mobileNumber=r),n&&(l.customerName=n),o&&(l.mobileNumber=o),s&&(l.carPlate=s),i&&(l.carModel=i),a&&(l.carColor=a),c&&(l.orderId=c),l}n.interceptors.response.use(void 0,(function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,o;return e.__generator(this,(function(e){switch(e.label){case 0:if(!t.config.retries)throw t;if(o=t.response&&t.response.status>499&&t.response.status<600,((r="ENOTFOUND"===t.code||"Network Error"===t.message)||o)&&!t.config.isRetryRequest)return t.config.isRetryRequest=!0,t.config.retryCount=0,[2,n(t.config)];if(void 0===t.config.retryCount)throw t;return(r||o)&&t.config.retryCount<t.config.retries?(l("Retry count: "+t.config.retryCount),[4,(i=Math.floor(100*Math.pow(t.config.retryCount,2))+Math.floor(100*Math.random()),new Promise((function(t){return setTimeout(t,i)})))]):[3,2];case 1:return e.sent(),t.config.retryCount+=1,[2,n(t.config)];case 2:throw t}var i}))}))}));var x=function(t,r,o){return e.__awaiter(void 0,void 0,void 0,(function(){var i;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.post(t,r,o)];case 1:return[2,e.sent()];case 2:if((i=e.sent()).config.retryCount&&i.config.retryCount>=i.config.retries)throw f.throwNetworkRetriesExceededError(i.config.retryCount,i);if(i.response&&400===i.response.status)throw f.throwValidationError("Bad request",i);throw f.throwUnexpectedServerError(void 0,i);case 3:return[2]}}))}))},z=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,o;return e.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(a=""+p.globalConfigUrl+t+".json",s={retries:p.remoteConfig.oneShot.maxAttempts},e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.get(a,s)];case 1:return[2,e.sent()];case 2:if((t=e.sent()).config.retryCount&&t.config.retryCount>=t.config.retries)throw f.throwNetworkRetriesExceededError(t.config.retryCount,t);throw f.throwUnexpectedServerError(void 0,t);case 3:return[2]}}))})))];case 1:return[2,i.sent()];case 2:if((r=i.sent()).name&&"UnexpectedServerError"===r.name&&(o=r.errorObject).response&&(404===o.response.status||403===o.response.status))throw f.throwProjectIdNotFoundError(void 0,r);throw r;case 3:return[2]}var a,s}))}))},k=function(){return!!global.localStorage},F=function(t,e){if(k()){var r=global.localStorage.getItem("installRefs"),o={};r&&(o=JSON.parse(r)),o[t]=e,global.localStorage.setItem("installRefs",JSON.stringify(o)),l("Storing installRef: "+e+" for projectId: "+t)}else u("localStorage object not found")},M=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,n,i,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),r=p.id,p.projectId=t,p.initializeStatus="inProgress",[4,z(t)];case 1:if(n=e.sent(),r!==p.id)throw f.throwInterruptedByResetError();return p.isInitialized=!0,p.initializeStatus="completed",k()&&((i=function(t){if(!k())return u("localStorage object not found"),null;var e=global.localStorage.getItem("installRefs");return e?JSON.parse(e)[t]:null}(t))?(p.installRef=i,l("Using stored installRef: "+i)):(p.installRef=o.v4(),p.userPersistenceEnabled&&F(t,p.installRef))),p.globalConfig=n.data,[3,3];case 2:throw a=e.sent(),p.initializeStatus="failed",c("An error occurred during initialization",a),a;case 3:return[2]}}))}))},O=new(function(){function t(){var t=this;this.emitter=new r.EventEmitter,this.emitter.on("locationError",(function(t){c("Failed to get positon",t)})),this.emitter.on("removeListener",(function(e){"locationUpdate"===e&&0===t.emitter.listenerCount("locationUpdate")&&null!=t.handlerId&&(l("Remove locationUpdate"),navigator.geolocation.clearWatch(t.handlerId))}))}return t.prototype.getUpdatedPosition=function(t){var e=this;"locationUpdate"===t&&(this.handlerId=navigator.geolocation.watchPosition((function(t){l("Emitting",t),e.emitter.emit("locationUpdate",t)}),(function(t){e.emitter.emit("locationError",t),e.emitter.emit("locationUpdate")}),{enableHighAccuracy:!0,maximumAge:5e3}))},t.prototype.addListener=function(t){l("Adding locationUpdate listener."),this.emitter.on("locationUpdate",t),this.getUpdatedPosition("locationUpdate")},t.prototype.removeListener=function(t){this.emitter.removeListener("locationUpdate",t)},t}()),V=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,o,n,i;return e.__generator(this,(function(a){switch(a.label){case 0:return r=function(){if(p.globalConfig){var t=p.globalConfig.eventsApiUrl;if(t)return t;throw new Error("Project does not have Events Api Url")}throw f.throwSdkNotInitializedError()}(),o={headers:{"x-bluedot-api-key":p.projectId},retries:p.remoteConfig.oneShot.maxAttempts},n=e.__assign({},t.notification),p&&p.installRef&&(n.installRef=p.installRef),t.location&&t.location.longitude&&t.location.latitude&&(n.location=(c={longitude:(s=t.location).longitude,latitude:s.latitude,horizontalAccuracy:s.accuracy},s.speed&&(c.speed=s.speed),s.heading&&(c.bearing=s.heading),c)),[4,x(r+"wave",n,o)];case 1:return i=a.sent(),l("Event sent"),[2,i]}var s,c}))}))},D=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return t.notificationType&&"wave"===t.notificationType?[2,V(t)]:[2]}))}))},q=function(){function t(t,r){this.attemptCount=0,this.bestEffort=null,this.isClosed=!1,this.notification=e.__assign({},t),this.notificationType=r}return t.prototype.trigger=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){return"failed"!==p.initializeStatus&&"notStarted"!==p.initializeStatus||f.throwSdkNotInitializedError(),p.locationEnabled?[2,this.trackAndSendLocation()]:[2,this.sendEvent()]}))}))},t.prototype.sendEvent=function(){return e.__awaiter(this,void 0,void 0,(function(){var t=this;return e.__generator(this,(function(r){return++this.attemptCount>1?(l("Previous event is in progress. Ignoring retrigger"),[2,null]):p.globalConfig?(l("Target region identified"),l("Sending event"),[2,D({notification:this.notification,notificationType:this.notificationType,location:this.bestEffort})]):[2,new Promise((function(r,o){l("Target region identification in progress. Listening..."),p.addListener((function n(i){return e.__awaiter(t,void 0,void 0,(function(){return e.__generator(this,(function(t){return l("State event emitted "+i),p.globalConfig?(l("Target region found. Sending event"),p.removeListener(n),D({notification:this.notification,notificationType:this.notificationType,location:this.bestEffort}).then(r).catch(o)):"failed"===p.initializeStatus?(p.removeListener(n),o(f.createError(d.SdkNotInitializedError,"SDK failed to initialize"))):l("No target region found."),[2]}))}))}))}))]}))}))},t.prototype.attemptSendEvent=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this.sendEvent()];case 1:return t.sent(),this.closeLocationPolling(),[2]}}))}))},t.prototype.closeLocationPolling=function(){!this.isClosed&&this.listener&&O.removeListener(this.listener),this.isClosed=!0},t.prototype.trackAndSendLocation=function(){return e.__awaiter(this,void 0,void 0,(function(){var t=this;return e.__generator(this,(function(r){return[2,new Promise((function(r){l("OneShotService: Adding location listener"),t.listener=function(o){return e.__awaiter(t,void 0,void 0,(function(){var t,n=this;return e.__generator(this,(function(e){return l("OneShotService: Received position",o),o&&o.coords&&o.coords.accuracy?null==this.bestEffort||this.bestEffort.accuracy&&this.bestEffort.accuracy<o.coords.accuracy?(o.coords.accuracy<p.remoteConfig.oneShot.minAccuracy&&(this.bestEffort=o.coords),p.isInitialized&&o.coords.accuracy<p.remoteConfig.oneShot.minAccuracy?r(this.attemptSendEvent()):(t=function(e){"isInitialized"===e&&(o.coords.accuracy&&o.coords.accuracy<p.remoteConfig.oneShot.minAccuracy&&r(n.attemptSendEvent()),p.removeListener(t))},p.addListener(t))):l("Lower accuracy than best effort, ignored."):r(this.attemptSendEvent()),[2]}))}))},O.addListener(t.listener),setTimeout((function(){return e.__awaiter(t,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return this.isClosed?[3,2]:(l("Send event on location timeout"),this.closeLocationPolling(),t=r,[4,this.sendEvent()]);case 1:t.apply(void 0,[e.sent()]),e.label=2;case 2:return[2]}}))}))}),p.remoteConfig.oneShot.timeout)}))]}))}))},t}(),B=new(function(){function t(){}return t.prototype.triggerOneShot=function(t,r){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,new q(t,r).trigger()]}))}))},t}());exports.bluedot={wave:{send:function(t,r){return e.__awaiter(void 0,void 0,void 0,(function(){var o,n,i,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),I(t,"destinationId"),(o={destinationId:t,eventTime:new Date(Date.now()).toISOString()}).customEventMetaData=r&&Object.prototype.hasOwnProperty.call(r,"convertToDataObject")?r.convertToDataObject():r,[4,B.triggerOneShot(o,"wave")];case 1:return e.sent(),[3,3];case 2:if(n=e.sent(),!Object.values(d).includes(n.name))throw f.throwUnexpectedServerError(void 0,n);if(n.errorObject&&(i=n.errorObject).response&&404===i.response.status&&(a=new RegExp(/destinationId/i),i.response&&i.response.data&&i.response.data.errorCauses&&i.response.data.errorCauses.length&&i.response.data.errorCauses[0].message.match(a)))throw f.throwNotFoundError("Zone with destinationId: "+t+" not found",n);throw n;case 3:return[2]}}))}))}},config:{setConfigurationDomain:function(t){t?(function(t){if(b(t))try{var e=new URL(t);return Boolean(e)}catch(t){c(t)}return!1}(t)||f.throwValidationError("BDGlobalConfigUrl must be a valid URL"),p.globalConfigUrl=t):p.globalConfigUrl="https://globalconfig.bluedot.io/"},setUserPersistenceEnabled:function(t){_(t,"enabled"),k()?(p.userPersistenceEnabled=t,t?p.projectId&&p.installRef&&F(p.projectId,p.installRef):(k()?global.localStorage.removeItem("installRefs"):u("localStorage object not found"),delete p.installRef)):u("User persistence is not available in this environment")},setDebugModeEnabled:function(t){_(t,"enabled"),function(t){a=t}(t)},setLocationMinimumAccuracy:function(t){y(t)||f.throwValidationError("Location accuracy must be a positive number"),p.remoteConfig.oneShot.minAccuracy=t},setLocationTimeout:function(t){(function(t){return Number.isInteger(t)&&y(t)})(t)||f.throwValidationError("Location timeout must be a positive integer number"),p.remoteConfig.oneShot.timeout=t}},initialize:function(t){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return function(t){return!!b(t)&&new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i).test(t)}(t)||f.throwValidationError("projectId must be a valid uuid"),"notStarted"!==p.initializeStatus&&f.throwValidationError("Bluedot SDK is already initialized with projectId: "+p.projectId+". You need to call reset before initializing again"),[2,M(t)]}))}))},reset:function(){p.reset()},setLocationEnabled:function(t){_(t,"locationEnabled"),p.locationEnabled=t,!0===t&&("undefined"==typeof navigator&&f.throwLocationAPINotAvailableError(),navigator.geolocation.getCurrentPosition((function(t){return l("Current location",t)})))}},exports.createHelloModel=function(){return{setCustomerName:U,setCustomDataField:j,setCarPlate:R,setCarModel:N,setEventType:P,setMobileNumber:L,setCarColor:A,setOrderId:C,convertToDataObject:T}};
"use strict";var t,e=require("tslib"),r=require("events"),o=require("uuid"),n=(t=require("axios"))&&"object"==typeof t&&"default"in t?t.default:t,i=function(){var t=new WeakMap;return function(e){return t.has(e)||t.set(e,{}),t.get(e)}},a=!1;function s(t,e,r){a&&(e&&r?t(e,r):t(e||r||new Error("Error logger called. See stack trace for details")))}var c=function(t,e){return s(console.error,t,e)},u=function(t,e){return s(console.warn,t,e)},l=function(t,e){return s(console.log,t,e)},d={ValidationError:"ValidationError",NetworkRetriesExceededError:"NetworkRetriesExceededError",UnexpectedServerError:"UnexpectedServerError",InvalidInputTypeError:"InvalidInputTypeError",RequiredValueMissingError:"RequiredValueMissingError",SdkNotInitializedError:"SdkNotInitializedError",ProjectIdNotFoundError:"ProjectIdNotFoundError",NotFoundError:"NotFoundError",InterruptedByResetError:"InterruptedByResetError",LocationAPINotAvailableError:"LocationAPINotAvailableError"},f={createError:function(t,e,r){var o=new Error(e);o.name=t;var n=o;return n.errorObject=r,u(e,n),n},throwInvalidInputTypeError:function(t,e){throw this.createError(d.InvalidInputTypeError,null!=t?t:"Invalid input type error",e)},throwNetworkRetriesExceededError:function(t,e){throw this.createError(d.NetworkRetriesExceededError,t?"Failed to communicate via network after "+t+" attempts":"Failed to communicate via network",e)},throwProjectIdNotFoundError:function(t,e){throw this.createError(d.ProjectIdNotFoundError,t?"Project with ID: "+t+" not found":"Project ID not found",e)},throwRequiredValueMissingError:function(t,e){throw this.createError(d.RequiredValueMissingError,t?"Cannot trigger event. Missing required value: "+t:"Cannot trigger event. Missing required value",e)},throwSdkNotInitializedError:function(t,e){throw this.createError(d.SdkNotInitializedError,null!=t?t:"SDK is not initialized with a valid projectId",e)},throwUnexpectedServerError:function(t,e){throw this.createError(d.UnexpectedServerError,null!=t?t:"An unexpected server error occurred. Check the attached errorObject for more details",e)},throwValidationError:function(t,e){throw this.createError(d.ValidationError,null!=t?t:"Invalid input was detected",e)},throwNotFoundError:function(t,e){throw this.createError(d.NotFoundError,null!=t?t:"Not found",e)},throwInterruptedByResetError:function(t,e){throw this.createError(d.InterruptedByResetError,null!=t?t:"Interrupted by reset",e)},throwLocationAPINotAvailableError:function(t,e){throw this.createError(d.LocationAPINotAvailableError,null!=t?t:"Location API is not available",e)}},h=new r.EventEmitter,v={remoteConfig:e.__assign({},{oneShot:{minAccuracy:50,targetAccuracy:20,maxAttempts:15,timeout:5e3}}),globalConfigUrl:"https://globalconfig.bluedot.io/",globalConfig:null,isInitialized:!1,initializeStatus:"notStarted",projectId:null,reset:m,addListener:w,removeListener:E,id:0,locationEnabled:!1,userPersistenceEnabled:!1},g=1,p=new Proxy(e.__assign({},v),{get:function(t,e){return t[e]},set:function(t,e,r){return t[e]=r,h.emit("stateUpdated",e),!0}});function m(){return Object.assign(p,v),p.reset=m,p.addListener=w,p.removeListener=E,p.id=g++,h.emit("stateReset"),h.removeAllListeners(),p}function w(t){return l("Adding state listener"),h.on("stateUpdated",t)}function E(t){h.removeListener("stateUpdated",t)}m();var b=function(t){return"string"==typeof t},y=function(t){return"number"==typeof t&&t>0},_=function(t,e){b(t)||f.throwInvalidInputTypeError(e+" must be a string")},I=function(t,e){_(t,"fieldName"),_(e,"fieldValue"),function(t){var e=["customername","carcolor","orderid","carplate","eventtype","carmodel","mobilenumber"];return t.toLowerCase().startsWith("hs_")?e.includes(t.slice(3).toLowerCase()):e.includes(t.toLowerCase())}(t)&&f.throwValidationError(t+" is a reserved keyword for Hello Screens. Use the helloModel method instead to set this value")},S=function(t,e){(function(t){return"boolean"==typeof t})(t)||f.throwInvalidInputTypeError(e+" must be a boolean")},C=i();function N(t){return _(t,"orderId"),C(this).orderId=t,this}function R(t){return _(t,"carModel"),C(this).carModel=t,this}function L(t){return _(t,"carPlate"),C(this).carPlate=t,this}function A(t){return _(t,"orderId"),C(this).carColor=t,this}function U(t){var e=function(t){var e;"string"==typeof t?e=t:"number"==typeof t&&(e=t.toString()),e||f.throwInvalidInputTypeError("mobileNumber must be a string");var r,o,n=e.replace(/ /g,"").replace(/-/g,"");return r=n,o=new RegExp(/^\+?[0-9]+$/),"string"==typeof r&&o.test(r)||f.throwValidationError("Invalid mobileNumber found. mobileNumber can only contain numerals or a leading + character"),n}(t);return C(this).mobileNumber=e,this}function P(t){return function(t){return!!b(t)&&["arrival","onTheWay"].includes(t)}(t)||f.throwValidationError("Invalid eventType found. eventType can only be 'arrival' or 'onTheWay'"),C(this).eventType=t,this}function j(t){return _(t,"customerName"),C(this).customerName=t,this}function T(t,e){I(t,e),function(t){t.toLowerCase().startsWith("hs_")&&f.throwValidationError("The hs_ prefix is reserved for fields that are displayed in Hello Screens. Use the setDisplayedCustomDataField method to set these values")}(t);var r=C(this).customFields;return void 0===r&&(r={},C(this).customFields=r),r[t]=e,this}function x(t,e){I(t,e);var r=C(this).displayedCustomFields;void 0===r&&(r={},C(this).displayedCustomFields=r);var o=r;return t.toLowerCase().startsWith("hs_")?o["hs_"+t.slice(3)]=e:o["hs_"+t]=e,this}function F(){var t=C(this),r=t.eventType,o=t.mobileNumber,n=t.customerName,i=t.carModel,a=t.carColor,s=t.carPlate,c=t.orderId,u=t.customFields,l=t.displayedCustomFields;c||f.throwRequiredValueMissingError("orderId");var d=l,h=e.__assign(e.__assign({},u),d);return r&&(h.hs_eventType=r),c&&(h.hs_orderId=c),n&&(h.hs_customerName=n),o&&(h["hs_Mobile Number"]=o),s&&(h["hs_Car Plate"]=s),i&&(h["hs_Car Model"]=i),a&&(h["hs_Car Color"]=a),h}n.interceptors.response.use(void 0,(function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,o;return e.__generator(this,(function(e){switch(e.label){case 0:if(!t.config.retries)throw t;if(o=t.response&&t.response.status>499&&t.response.status<600,((r="ENOTFOUND"===t.code||"Network Error"===t.message)||o)&&!t.config.isRetryRequest)return t.config.isRetryRequest=!0,t.config.retryCount=0,[2,n(t.config)];if(void 0===t.config.retryCount)throw t;return(r||o)&&t.config.retryCount<t.config.retries?(l("Retry count: "+t.config.retryCount),[4,(i=Math.floor(100*Math.pow(t.config.retryCount,2))+Math.floor(100*Math.random()),new Promise((function(t){return setTimeout(t,i)})))]):[3,2];case 1:return e.sent(),t.config.retryCount+=1,[2,n(t.config)];case 2:throw t}var i}))}))}));var z=function(t,r,o){return e.__awaiter(void 0,void 0,void 0,(function(){var i;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.post(t,r,o)];case 1:return[2,e.sent()];case 2:if((i=e.sent()).config.retryCount&&i.config.retryCount>=i.config.retries)throw f.throwNetworkRetriesExceededError(i.config.retryCount,i);if(i.response&&400===i.response.status)throw f.throwValidationError("Bad request",i);throw f.throwUnexpectedServerError(void 0,i);case 3:return[2]}}))}))},M=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,o;return e.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(a=""+p.globalConfigUrl+t+".json",s={retries:p.remoteConfig.oneShot.maxAttempts},e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.get(a,s)];case 1:return[2,e.sent()];case 2:if((t=e.sent()).config.retryCount&&t.config.retryCount>=t.config.retries)throw f.throwNetworkRetriesExceededError(t.config.retryCount,t);throw f.throwUnexpectedServerError(void 0,t);case 3:return[2]}}))})))];case 1:return[2,i.sent()];case 2:if((r=i.sent()).name&&"UnexpectedServerError"===r.name&&(o=r.errorObject).response&&(404===o.response.status||403===o.response.status))throw f.throwProjectIdNotFoundError(void 0,r);throw r;case 3:return[2]}var a,s}))}))},k=function(){return!!global.localStorage},O=function(t,e){if(k()){var r=global.localStorage.getItem("installRefs"),o={};r&&(o=JSON.parse(r)),o[t]=e,global.localStorage.setItem("installRefs",JSON.stringify(o)),l("Storing installRef: "+e+" for projectId: "+t)}else u("localStorage object not found")},D=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,n,i,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),r=p.id,p.projectId=t,p.initializeStatus="inProgress",[4,M(t)];case 1:if(n=e.sent(),r!==p.id)throw f.throwInterruptedByResetError();return p.isInitialized=!0,p.initializeStatus="completed",k()&&((i=function(t){if(!k())return u("localStorage object not found"),null;var e=global.localStorage.getItem("installRefs");return e?JSON.parse(e)[t]:null}(t))?(p.installRef=i,l("Using stored installRef: "+i)):(p.installRef=o.v4(),p.userPersistenceEnabled&&O(t,p.installRef))),p.globalConfig=n.data,[3,3];case 2:throw a=e.sent(),p.initializeStatus="failed",c("An error occurred during initialization",a),a;case 3:return[2]}}))}))},V=new(function(){function t(){var t=this;this.emitter=new r.EventEmitter,this.emitter.on("locationError",(function(t){c("Failed to get positon",t)})),this.emitter.on("removeListener",(function(e){"locationUpdate"===e&&0===t.emitter.listenerCount("locationUpdate")&&null!=t.handlerId&&(l("Remove locationUpdate"),navigator.geolocation.clearWatch(t.handlerId))}))}return t.prototype.getUpdatedPosition=function(t){var e=this;"locationUpdate"===t&&(this.handlerId=navigator.geolocation.watchPosition((function(t){l("Emitting",t),e.emitter.emit("locationUpdate",t)}),(function(t){e.emitter.emit("locationError",t),e.emitter.emit("locationUpdate")}),{enableHighAccuracy:!0,maximumAge:5e3}))},t.prototype.addListener=function(t){l("Adding locationUpdate listener."),this.emitter.on("locationUpdate",t),this.getUpdatedPosition("locationUpdate")},t.prototype.removeListener=function(t){this.emitter.removeListener("locationUpdate",t)},t}()),q=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var r,o,n,i;return e.__generator(this,(function(a){switch(a.label){case 0:return r=function(){if(p.globalConfig){var t=p.globalConfig.eventsApiUrl;if(t)return t;throw new Error("Project does not have Events Api Url")}throw f.throwSdkNotInitializedError()}(),o={headers:{"x-bluedot-api-key":p.projectId},retries:p.remoteConfig.oneShot.maxAttempts},n=e.__assign({},t.notification),p&&p.installRef&&(n.installRef=p.installRef),t.location&&t.location.longitude&&t.location.latitude&&(n.location=(c={longitude:(s=t.location).longitude,latitude:s.latitude,horizontalAccuracy:s.accuracy},s.speed&&(c.speed=s.speed),s.heading&&(c.bearing=s.heading),c)),[4,z(r+"wave",n,o)];case 1:return i=a.sent(),l("Event sent"),[2,i]}var s,c}))}))},B=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return t.notificationType&&"wave"===t.notificationType?[2,q(t)]:[2]}))}))},W=function(){function t(t,r){this.attemptCount=0,this.bestEffort=null,this.isClosed=!1,this.notification=e.__assign({},t),this.notificationType=r}return t.prototype.trigger=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){return"failed"!==p.initializeStatus&&"notStarted"!==p.initializeStatus||f.throwSdkNotInitializedError(),p.locationEnabled?[2,this.trackAndSendLocation()]:[2,this.sendEvent()]}))}))},t.prototype.sendEvent=function(){return e.__awaiter(this,void 0,void 0,(function(){var t=this;return e.__generator(this,(function(r){return++this.attemptCount>1?(l("Previous event is in progress. Ignoring retrigger"),[2,null]):p.globalConfig?(l("Target region identified"),l("Sending event"),[2,B({notification:this.notification,notificationType:this.notificationType,location:this.bestEffort})]):[2,new Promise((function(r,o){l("Target region identification in progress. Listening..."),p.addListener((function n(i){return e.__awaiter(t,void 0,void 0,(function(){return e.__generator(this,(function(t){return l("State event emitted "+i),p.globalConfig?(l("Target region found. Sending event"),p.removeListener(n),B({notification:this.notification,notificationType:this.notificationType,location:this.bestEffort}).then(r).catch(o)):"failed"===p.initializeStatus?(p.removeListener(n),o(f.createError(d.SdkNotInitializedError,"SDK failed to initialize"))):l("No target region found."),[2]}))}))}))}))]}))}))},t.prototype.attemptSendEvent=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this.sendEvent()];case 1:return t.sent(),this.closeLocationPolling(),[2]}}))}))},t.prototype.closeLocationPolling=function(){!this.isClosed&&this.listener&&V.removeListener(this.listener),this.isClosed=!0},t.prototype.trackAndSendLocation=function(){return e.__awaiter(this,void 0,void 0,(function(){var t=this;return e.__generator(this,(function(r){return[2,new Promise((function(r){l("OneShotService: Adding location listener"),t.listener=function(o){return e.__awaiter(t,void 0,void 0,(function(){var t,n=this;return e.__generator(this,(function(e){return l("OneShotService: Received position",o),o&&o.coords&&o.coords.accuracy?null==this.bestEffort||this.bestEffort.accuracy&&this.bestEffort.accuracy<o.coords.accuracy?(o.coords.accuracy<p.remoteConfig.oneShot.minAccuracy&&(this.bestEffort=o.coords),p.isInitialized&&o.coords.accuracy<p.remoteConfig.oneShot.minAccuracy?r(this.attemptSendEvent()):(t=function(e){"isInitialized"===e&&(o.coords.accuracy&&o.coords.accuracy<p.remoteConfig.oneShot.minAccuracy&&r(n.attemptSendEvent()),p.removeListener(t))},p.addListener(t))):l("Lower accuracy than best effort, ignored."):r(this.attemptSendEvent()),[2]}))}))},V.addListener(t.listener),setTimeout((function(){return e.__awaiter(t,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return this.isClosed?[3,2]:(l("Send event on location timeout"),this.closeLocationPolling(),t=r,[4,this.sendEvent()]);case 1:t.apply(void 0,[e.sent()]),e.label=2;case 2:return[2]}}))}))}),p.remoteConfig.oneShot.timeout)}))]}))}))},t}(),H=new(function(){function t(){}return t.prototype.triggerOneShot=function(t,r){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,new W(t,r).trigger()]}))}))},t}());exports.bluedot={wave:{send:function(t,r){return e.__awaiter(void 0,void 0,void 0,(function(){var o,n,i,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),_(t,"destinationId"),(o={destinationId:t,eventTime:new Date(Date.now()).toISOString()}).customEventMetaData=r&&Object.prototype.hasOwnProperty.call(r,"convertToDataObject")?r.convertToDataObject():r,[4,H.triggerOneShot(o,"wave")];case 1:return e.sent(),[3,3];case 2:if(n=e.sent(),!Object.values(d).includes(n.name))throw f.throwUnexpectedServerError(void 0,n);if(n.errorObject&&(i=n.errorObject).response&&404===i.response.status&&(a=new RegExp(/destinationId/i),i.response&&i.response.data&&i.response.data.errorCauses&&i.response.data.errorCauses.length&&i.response.data.errorCauses[0].message.match(a)))throw f.throwNotFoundError("Zone with destinationId: "+t+" not found",n);throw n;case 3:return[2]}}))}))}},config:{setConfigurationDomain:function(t){t?(function(t){if(b(t))try{var e=new URL(t);return Boolean(e)}catch(t){c(t)}return!1}(t)||f.throwValidationError("BDGlobalConfigUrl must be a valid URL"),p.globalConfigUrl=t):p.globalConfigUrl="https://globalconfig.bluedot.io/"},setUserPersistenceEnabled:function(t){S(t,"enabled"),k()?(p.userPersistenceEnabled=t,t?p.projectId&&p.installRef&&O(p.projectId,p.installRef):(k()?global.localStorage.removeItem("installRefs"):u("localStorage object not found"),delete p.installRef)):u("User persistence is not available in this environment")},setDebugModeEnabled:function(t){S(t,"enabled"),function(t){a=t}(t)},setLocationMinimumAccuracy:function(t){y(t)||f.throwValidationError("Location accuracy must be a positive number"),p.remoteConfig.oneShot.minAccuracy=t},setLocationTimeout:function(t){(function(t){return Number.isInteger(t)&&y(t)})(t)||f.throwValidationError("Location timeout must be a positive integer number"),p.remoteConfig.oneShot.timeout=t}},initialize:function(t){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return function(t){return!!b(t)&&new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i).test(t)}(t)||f.throwValidationError("projectId must be a valid uuid"),"notStarted"!==p.initializeStatus&&f.throwValidationError("Bluedot SDK is already initialized with projectId: "+p.projectId+". You need to call reset before initializing again"),[2,D(t)]}))}))},reset:function(){p.reset()},setLocationEnabled:function(t){S(t,"locationEnabled"),p.locationEnabled=t,!0===t&&("undefined"==typeof navigator&&f.throwLocationAPINotAvailableError(),navigator.geolocation.getCurrentPosition((function(t){return l("Current location",t)})))}},exports.createHelloModel=function(){return{setCustomerName:j,setCustomDataField:T,setCarPlate:L,setCarModel:R,setEventType:P,setMobileNumber:U,setCarColor:A,setOrderId:N,convertToDataObject:F,setDisplayedCustomDataField:x}};
//# sourceMappingURL=javascript-sdk.cjs.production.min.js.map

@@ -245,2 +245,7 @@ import { __assign, __awaiter, __generator } from 'tslib';

var reservedFieldNames = ['customername', 'carcolor', 'orderid', 'carplate', 'eventtype', 'carmodel', 'mobilenumber'];
if (fieldName.toLowerCase().startsWith('hs_')) {
return reservedFieldNames.includes(fieldName.slice(3).toLowerCase());
}
return reservedFieldNames.includes(fieldName.toLowerCase());

@@ -261,2 +266,7 @@ };

};
var validateNotDisplayedCustomField = function validateNotDisplayedCustomField(fieldName) {
if (fieldName.toLowerCase().startsWith('hs_')) {
errorFactory.throwValidationError('The hs_ prefix is reserved for fields that are displayed in Hello Screens. Use the setDisplayedCustomDataField method to set these values');
}
};
var validateIsBoolean = function validateIsBoolean(input, fieldName) {

@@ -372,2 +382,3 @@ if (!isBoolean(input)) {

validateHelloScreensCustomDataField(fieldName, fieldValue);
validateNotDisplayedCustomField(fieldName);
var customFields = privateStore(this).customFields;

@@ -385,2 +396,22 @@

function setDisplayedCustomDataField(fieldName, fieldValue) {
validateHelloScreensCustomDataField(fieldName, fieldValue);
var displayedCustomFields = privateStore(this).displayedCustomFields;
if (displayedCustomFields === undefined) {
displayedCustomFields = {};
privateStore(this).displayedCustomFields = displayedCustomFields;
}
var displayedCustomFieldsObject = displayedCustomFields;
if (fieldName.toLowerCase().startsWith('hs_')) {
displayedCustomFieldsObject["hs_" + fieldName.slice(3)] = fieldValue;
} else {
displayedCustomFieldsObject["hs_" + fieldName] = fieldValue;
}
return this;
}
function convertToDataObject() {

@@ -395,3 +426,4 @@ var _a = privateStore(this),

orderId = _a.orderId,
customFields = _a.customFields;
customFields = _a.customFields,
displayedCustomFields = _a.displayedCustomFields;

@@ -403,37 +435,34 @@ if (!orderId) {

var castedCustomFields = customFields;
var castedDisplayedCustomFields = displayedCustomFields;
var helloDataTemplate = __assign({}, castedCustomFields);
var helloDataTemplate = __assign(__assign({}, castedCustomFields), castedDisplayedCustomFields);
if (eventType) {
helloDataTemplate.eventType = eventType;
helloDataTemplate.hs_eventType = eventType;
}
if (mobileNumber) {
helloDataTemplate.mobileNumber = eventType;
if (orderId) {
helloDataTemplate.hs_orderId = orderId;
}
if (customerName) {
helloDataTemplate.customerName = customerName;
helloDataTemplate.hs_customerName = customerName;
}
if (mobileNumber) {
helloDataTemplate.mobileNumber = mobileNumber;
helloDataTemplate['hs_Mobile Number'] = mobileNumber;
}
if (carPlate) {
helloDataTemplate.carPlate = carPlate;
helloDataTemplate['hs_Car Plate'] = carPlate;
}
if (carModel) {
helloDataTemplate.carModel = carModel;
helloDataTemplate['hs_Car Model'] = carModel;
}
if (carColor) {
helloDataTemplate.carColor = carColor;
helloDataTemplate['hs_Car Color'] = carColor;
}
if (orderId) {
helloDataTemplate.orderId = orderId;
}
return helloDataTemplate;

@@ -459,3 +488,4 @@ }

setOrderId: setOrderId,
convertToDataObject: convertToDataObject
convertToDataObject: convertToDataObject,
setDisplayedCustomDataField: setDisplayedCustomDataField
};

@@ -462,0 +492,0 @@ }

@@ -8,11 +8,13 @@ export declare type HelloEventType = 'arrival' | 'onTheWay' | undefined;

* Allowed options for a Hello Screens order.
*
* Use the corresponding setter methods to set these fields
*/
export interface HelloDataTemplate extends Partial<Record<string, string>> {
orderId?: string;
customerName?: string;
carModel?: string;
carPlate?: string;
carColor?: string;
mobileNumber?: string;
eventType?: HelloEventType;
['hs_orderId']?: string;
['hs_customerName']?: string;
['hs_eventType']?: HelloEventType;
['hs_Car Model']?: string;
['hs_Car Plate']?: string;
['hs_Car Color']?: string;
['hs_Mobile Number']?: string;
}

@@ -87,3 +89,5 @@ /**

/**
* Set a custom data field
* Set a custom data field. These fields will be included in the wave event and any associated webhook, but
* will not be displayed in Hello Screens or returned from Hello API
*
* @param fieldName The key for the custom data field

@@ -99,2 +103,15 @@ * @param fieldValue The value for the custom data field

/**
* Set a custom data field which will be returned from Hello API and displayed in the Order Details view in Hello Screens.
* Please note these fields will be prefixed with an hs_ in any received webhooks for the events
*
* @param fieldName The key for the custom data field
* @param fieldValue The value for the custom data field
* @return the Hello Helper object
*
* @throws InvalidTypeError This exception is thrown if the fieldName or fieldValue is not a string
*
* @throws ValidationError This exception is thrown if a given fieldName is a field reserved by HelloModel. Use the specific method for this property instead
*/
setDisplayedCustomDataField: (fieldName: string, fieldValue: string) => HelloModel;
/**
* Returns all stored values as a data object

@@ -101,0 +118,0 @@ * @return An object containing all values stored by the Hello Helper

@@ -12,2 +12,3 @@ export declare const isString: (input: unknown) => boolean;

export declare const validateHelloScreensCustomDataField: (fieldName: unknown, fieldValue: unknown) => void;
export declare const validateNotDisplayedCustomField: (fieldName: string) => void;
export declare const validateIsBoolean: (input: unknown, fieldName: string) => void;

@@ -14,0 +15,0 @@ export declare const validateIsUrl: (input: unknown, fieldName: string) => void;

{
"name": "@bluedot-innovation/javascript-sdk",
"version": "1.0.1",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc