Tiny Klaviyo list subscribe utility.
npm i klaviyo-subscribe --save
import { subscribe } from "klaviyo-subscribe";
const listId = "JFDd6y";
const email = "email@email.com";
subscribe(listId, email, {
$first_name: "Eric"
// any optional traits
}).then(response => {});
Sending Custom field data into a list:
import { subscribe } from "klaviyo-subscribe";
const listId = "JFDd6y";
const email = "email@email.com";
subscribe(listId, email, {
$fields: ["Size", "Type"],
Size: 10,
Type: "US Mens"
}).then(response => {});
MIT License © Eric Bailey