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

@quantum-sa/cdp

v1.0.4

Published

CDP is a customer data platform, where any company wishing to understand thier user behaviours can set it up and increase conversions. Talk to us to learn more at support[at]quantums.sa

Downloads

34

Readme

@quantum-sa/cdp

What is a CDP?

CDP stands for Customer Data Platform. It's like a central hub where businesses store all the information they have about their customers. This includes things like their purchases, interactions, and preferences. The cool thing about CDPs is that they organize this data so businesses can use it to improve their marketing, customer service, and overall experience for customers. Think of it as a smart filing system for customer information

How to get it?
  • Share your use-case with us here
  • We will understand your requirements and suggest you the best course of action
  • We will share required environment variables which you can replace and after installing the SDK and start improving your conversions from day one!

Installation

npm install @quantum-sa/cdp

How-To

After you have installed the sdk, you will need to activate it by supplying some environment variables to be able to interact with it. Our support team will be responsible for sharing this information with you + onboarding you to get the most benefit out of it.

Initial setup: [index.js]

import {SDK} from '@quantum-sa/cdp';
OR const {SDK} = require("@quantum-sa/cdp");

const client = new SDK({
    base_url: <BASE_URL>,
    site_id: <SITE_ID>,
    api_key: <API_KEY>
});

After this initial configuration, you will be able to interact with different modules inside this SDK as shown below:

Create Customer

  try {
    const customer = await client.customers.createCustomer
    ({
        ...customer_fields
    });
  } catch (error) {
    console.log(error.message);
  }

| Customer Fields | Type | Required | ------ | ------ | ------ | | local_id | string | true | | email | string | true | | name | string | true | | interest | string | false | | age | string | false | | phone | string | false | | company_name | string | false | | job_position | string | false | | profile_photo | string | false | | custom_key | string | false |

Update Customer

  try {
    const customer = await client.customers.updateCustomer
    ({
        ...customer_fields
    });
    console.log(customer)
  } catch (error) {
    console.log(error.message);
  }

updating a customer will replace the existing record, so make sure to send existing+updated payload alongside all the required fields.

Create Event

After you are done with creating a customer, you can use their email to register events to create a journey of that user on your platform. Details are mentioned below:

  try {
    const event = await client.events.createEvent
    ({
        ...event_fields
    });
    console.log(event)
  } catch (error) {
    console.log(error.message);
  }`

| Event Fields | Type | Required | ------ | ------ | ------ | | email | string | true | | name | string | true | | type | string | true ['event','page'] | | data | object | false |

you can only pass event|page as event type, and add additional data by passing it into the data object.

Create Device

After you are done with creating a customer, you can use their email to associate devices. E.g. if you are running a mobile application, whenever changes their device upon login, you can send that information to this endpoint which will keep track of all device changes against a customer's email. This can become a unique data point to be used in marketing campaigns later on.

  try {
    const device = await client.devices.createDevice
    ({
        ...device_fields
    });
    console.log(device)
  } catch (error) {
    console.log(error.message);
  }`

| Device Fields | Type | Required | Comments | ------ | ------ | ------ | ------ | | email | string | true | - | | device_token | string | true | Unique token of the device | | platform | string | true | e.g. Android/IPhone | | attributes | object | false | See below |

You can use the following keys for device attributes:

| Attr. Fields | Type | Required | Comments | ------ | ------ | ------ | ------ | | device_os | string | false | e.g Android:13.0.1 | | device_model | string | false | e.g. TFY-LX2 | | app_version | string | false | e.g. current version of your app | | pio_sdk_version | string | false | e.g. current version of this sdk | | push_enabled | boolean | false | This is the user's preference of receiving PNs | | push_token | string | false | We use FCM for push notification campaigns, so this should be a valid token received from FCM if it is configured |

License

MIT