npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

klaviyo-node

v1.0.8

Published

Node API for Klaviyo

Downloads

991

Readme

Klaviyo Node.js CircleCI

A third party maintained Node.js package for sending Klaviyo events

What is Klaviyo?

Klaviyo is a real-time service for understanding your customers by aggregating all your customer data, identifying important groups of customers and then taking action. http://www.klaviyo.com/

What does this package do?

  • Track customers and events directly from your backend.

How to install?

npm install klaviyo-node

API Examples

After installing the klaviyo package you can initiate it using your public token which is for track events or identifying profiles and/or your private API key to utilize the metrics and list APIs.

const Klaviyo = require('klaviyo-node');

client = new Klaviyo(PUBLIC_TOKEN);

You can then easily use Klaviyo to track events or identify people. Note, track and identify requests take your public token.

// Track an event...
client.track('Filled out profile', '[email protected]', {
  'Added social accounts': false,
});

// you can also add profile properties
client.track(
    'Filled out profile',
    '[email protected]',
    {
      'Added social accounts': false,
    },
    {
      '$first_name': 'Thomas',
      '$last_name': 'Jefferson',
    }
);

// ...or just add a property to someone
client.identify('[email protected]', {
  '$first_name': 'Thomas',
  '$last_name': 'Jefferson',
  'Plan': 'Premium',
});

More details about the Klaviyo API can be found here: https://www.klaviyo.com/docs/http-api

Documentation

The methods in the package are documented in the docs folder of the repository.

Contributing

Everyone is welcome to contribute to this package. Simply make sure there are no errors and your contribution passes the CircleCI test and we will review and hopefully merge your changes.

This package uses yarn as a package manager, which provides several benefits over npm. After having run npm install, you should be able to use the yarn command in your CLI.

To make sure your package is ready for a Pull Request, please run yarn build. The build script will check styling, create documentation (you should check in the changes in the /docs folder) and check the spelling in your documentation.

Testing

This package uses jest to run tests. You can easily run all the tests using yarn test.

Style Guide

This package uses ESLint with the Google JavaScript Style Guide. Styling is strictly enforced and CircleCI will return an error when there are styling issues with your contribution. You can run the linter by executing yarn lint.

Documentation

The Google JavaScript Style Guide enforces that JSDoc is used on all classes, fields, and methods. The JSDoc strings are used by jsdoc-to-markdown to generate documentation in /docs.

Spelling

We like correct spelling even in documentation. A spellchecker is run on all markdown files, including the ones that were generated based on the JSDoc strings and a Pull Request will fail checks if there are spelling issues. The spellchecker doesn't recognize parameter, method, and class names and those obviously don't need to be English words. To make sure your new parameter, method, and class names are accepted by the spellchecker, you can run yarn spelling to interactively add these names to the local dictionary (.spelling).