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.0.2 to 3.0.3-beta.1

11

dist/lib/request.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const https_1 = require("https");
const url_1 = require("url");
const utils_1 = require("./utils");

@@ -32,4 +33,10 @@ const TIMEOUT = 10000;

return new Promise((resolve, reject) => {
let options = Object.assign({}, this.defaults, { method, headers });
let req = https_1.request(uri, options, (res) => {
let url = new url_1.URL(uri);
let options = Object.assign({}, this.defaults, {
method,
headers,
hostname: url.hostname,
path: url.pathname,
});
let req = https_1.request(options, (res) => {
let chunks = [];

@@ -36,0 +43,0 @@ res.on('data', (data) => {

13

lib/request.ts
import { request } from 'https';
import type { RequestOptions } from 'https';
import { URL } from 'url';
import { CustomerIORequestError } from './utils';

@@ -54,3 +55,3 @@

'Content-Type': 'application/json',
'Content-Length': body ? Buffer.byteLength(body,'utf8') : 0,
'Content-Length': body ? Buffer.byteLength(body, 'utf8') : 0,
};

@@ -63,4 +64,10 @@

return new Promise((resolve, reject) => {
let options = Object.assign({}, this.defaults, { method, headers });
let req = request(uri, options, (res) => {
let url = new URL(uri);
let options = Object.assign<{}, RequestOptions, RequestOptions>({}, this.defaults, {
method,
headers,
hostname: url.hostname,
path: url.pathname,
});
let req = request(options, (res) => {
let chunks: Buffer[] = [];

@@ -67,0 +74,0 @@

{
"name": "customerio-node",
"description": "A node client for the Customer.io event API. http://customer.io",
"version": "3.0.2",
"version": "3.0.3-beta.1",
"author": "Customer.io (https://customer.io)",

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

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

# Customerio [![test](https://github.com/customerio/customerio-node/actions/workflows/main.yml/badge.svg)](https://github.com/customerio/customerio-node/actions/workflows/main.yml)
# Customer.io [![test](https://github.com/customerio/customerio-node/actions/workflows/main.yml/badge.svg)](https://github.com/customerio/customerio-node/actions/workflows/main.yml)

@@ -58,2 +58,12 @@ A node client for the Customer.io [REST API](https://learn.customer.io/api/).

#### Updating identifiers
If you want to update an identifier for an existing profile, you must reference them using their `cio_id` in the format `cio_<cio_id_value>`. Using anything else will result in an attribute update failure in Customer.io. You can read more about [updating customers](https://customer.io/docs/api/#operation/identify) on our API documentation.
```
cio.identify(`cio_${customer.cio_id}`, {
email: 'new_email@example.com'
});
```
---

@@ -60,0 +70,0 @@

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