New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ingrow-js-sdk

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ingrow-js-sdk - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

dist/index.js

76

index.js

@@ -1,75 +0,1 @@

class cookieHandler {
static getRandomString = () => {
var randomChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
var result = ''
for ( var i = 0; i < 32; i++ ) {
result += randomChars.charAt(Math.floor(Math.random() * randomChars.length))
}
return result
}
static setCookie = (cname) => {
const cookie = cookieHandler.getRandomString()
document.cookie = cname + "=" + cookie
return cookie
}
static getCookie = (cname) => {
var name = cname + "="
var ca = document.cookie.split(';')
for(var i = 0; i < ca.length; i++) {
var c = ca[i]
while (c.charAt(0) == ' ') {
c = c.substring(1)
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length)
}
}
return ""
}
static checkCookie = (cname) => {
var id = cookieHandler.getCookie(cname)
if (id != "") {
return true
} else {
return false
}
}
}
export default class lungo {
constructor(apiKey, projectID) {
this.apiKey = apiKey
this.projectID = projectID
this.apiEndpoint = process?.env?.LUNGO_ENDPOINT || "https://event.st.ingrow.co"
this.anonymousId = cookieHandler.checkCookie("ingrow_events_anonymous_id")
? cookieHandler.getCookie("ingrow_events_anonymous_id")
: cookieHandler.setCookie("ingrow_events_anonymous_id")
this.ip = { IP: "autofill" }
}
sendEvent(stream, data, userId = "") {
return fetch(`${this.apiEndpoint}/v1`, {
method: "POST",
headers: {
"api-key": this.apiKey,
},
body: JSON.stringify({
ingrow: {
stream,
project: this.projectID,
},
enrichment: [{
name: "session",
input: {
anonymous_id: this.anonymousId,
user_id: userId,
}
}],
event: { ...this.ip, ...data },
}),
})
}
}
module.exports = require("./dist")
{
"name": "ingrow-js-sdk",
"version": "1.0.5",
"version": "1.0.6",
"description": "javascript SDK to using the Ingrow event streaming platform",

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

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