0.1.0 • Published 3 years ago

@knocklabs/node-sdk v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Knock Node SDK

Node client for interacting with the Knock API, designed to be integrated into your API.

Usage

const client = new Knock(apiKey, options);

client.identify({
  user_id: user.id,
  properties: {
    name: user.name,
    email: user.email,
  },
});

client.track({
  user_id: user.id,
  name: "NewComment",
  properties: {
    page_id: page._id,
    page_name: page.blocks[0].html.toString(),
    comment_text: commentText,
    comment_id: savedComment._id,
  },
  followers: page.followers,
});