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

customerio-node

Package Overview
Dependencies
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

customerio-node - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

4

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
## [3.1.2]
- Set `User-Agent` for property source attributes on activity logs ([#93](https://github.com/customerio/customerio-node/pull/93))
## [3.1.1]

@@ -5,0 +9,0 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const https_1 = require("https");
const url_1 = require("url");
const fs_1 = __importDefault(require("fs"));
const path_1 = require("path");
const utils_1 = require("./utils");
const TIMEOUT = 10000;
const PACKAGE_JSON = fs_1.default.readFileSync(path_1.resolve(__dirname, '..', 'package.json'));
class CIORequest {

@@ -24,2 +30,10 @@ constructor(auth, defaults) {

const body = data ? JSON.stringify(data) : null;
let libraryVersion = 'Unknown';
try {
let json = JSON.parse(PACKAGE_JSON.toString());
libraryVersion = json.version;
}
catch (_a) {
console.warn('WARN: package.json contents could not be read. Activity source data in Customer.io will be incorrect.');
}
const headers = {

@@ -29,2 +43,3 @@ Authorization: this.auth,

'Content-Length': body ? Buffer.byteLength(body, 'utf8') : 0,
'User-Agent': `Customer.io Node Client/${libraryVersion}`,
};

@@ -31,0 +46,0 @@ return { method, uri, headers, body };

import { request } from 'https';
import type { RequestOptions } from 'https';
import { URL } from 'url';
import fs from 'fs';
import { resolve } from 'path';
import { CustomerIORequestError } from './utils';

@@ -23,2 +25,3 @@

const TIMEOUT = 10_000;
const PACKAGE_JSON = fs.readFileSync(resolve(__dirname, '..', 'package.json'));

@@ -53,2 +56,14 @@ export default class CIORequest {

const body = data ? JSON.stringify(data) : null;
let libraryVersion = 'Unknown';
try {
let json = JSON.parse(PACKAGE_JSON.toString());
libraryVersion = json.version;
} catch {
console.warn(
'WARN: package.json contents could not be read. Activity source data in Customer.io will be incorrect.',
);
}
const headers = {

@@ -58,2 +73,3 @@ Authorization: this.auth,

'Content-Length': body ? Buffer.byteLength(body, 'utf8') : 0,
'User-Agent': `Customer.io Node Client/${libraryVersion}`,
};

@@ -60,0 +76,0 @@

2

package.json
{
"name": "customerio-node",
"description": "A node client for the Customer.io event API. http://customer.io",
"version": "3.1.1",
"version": "3.1.2",
"author": "Customer.io (https://customer.io)",

@@ -6,0 +6,0 @@ "contributors": [

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