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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rejoiner

v2.17.1

Published

Rejoiner REST API client wrapper for Node.js

Downloads

410

Readme

Rejoiner Node.js Client

A Node.js client for the Rejoiner email marketing and cart abandonment platform API.

Install

npm install rejoiner --save

Configuration

const Rejoiner = require('rejoiner')

const client = new Rejoiner({
  siteId: 'yourSiteId',
  apiKey: 'yourApiKey',

  // Optional
  apiVersion: 2,              // API version: 1 (default) or 2
  webhookSecret: 'secret',    // For webhook verification
})

Environment Variables

Configuration can also be set via environment variables:

  • REJOINER_SITE_ID - Your site ID
  • REJOINER_API_KEY - Your API key
  • REJOINER_WEBHOOK_SECRET - Webhook secret for verification (optional)
// With env vars set, you can instantiate without options
const client = new Rejoiner()

Verify Credentials

client.verify.ping()

Webhooks

Verify incoming webhook signatures:

const signatureHeader = req.headers['x-rejoiner-signature']
const payload = req.rawBody // Raw request body as string

const isValid = client.verifyWebhook(signatureHeader, payload)

Requires webhookSecret to be configured.

Customer Endpoints

Get Customer

// By email (API v1 and v2)
client.customer.get('[email protected]')
client.customer.getByEmail('[email protected]')

// By phone (API v2 only)
client.customer.getByPhone('+15551234567')
client.customer.get('+15551234567', 'by_phone')

Update Customer

client.customer.update({
  email: '[email protected]',
  first_name: 'Test',
  last_name: 'User',
  // ... other customer fields
})

Convert Customer

client.customer.convert({
  email: '[email protected]',
  cart_data: {
    cart_value: 20000,
    cart_item_count: 2,
    promo: 'COUPON_CODE',
    return_url: 'https://www.example.com/cart',
  },
  cart_items: [
    {
      product_id: 'SKU123',
      name: 'Example Product',
      price: 10000,
      item_qty: 2,
      qty_price: 20000,
      product_url: 'https://www.example.com/products/example',
      image_url: 'https://www.example.com/images/example.jpg',
    },
  ],
})

// Force conversion even if customer already converted
client.customer.convert(data, true)

Cancel Journey

client.customer.cancel('[email protected]')

Unsubscribe Customer

client.customer.unsubscribe('[email protected]')

Record Opt-In Consent

client.customer.optIn('[email protected]')

Customer Tags (API v2 only)

Manage customer tags for segmentation and journey triggers.

// Get tags
client.customer.tags.get('[email protected]')

// Replace all tags
client.customer.tags.set('[email protected]', ['vip', 'newsletter'])

// Add tags
client.customer.tags.add('[email protected]', ['new-tag'])

// Remove tags
client.customer.tags.remove('[email protected]', ['old-tag'])

The set, add, and remove methods accept an optional third parameter startJourney (default: true). Set to false to prevent triggering journeys:

client.customer.tags.add('[email protected]', ['tag'], false)

Preference Tags

Manage customer preference tags for email preferences.

// Get preference tags
client.customer.preferenceTags.get('[email protected]')

// Replace all preference tags
client.customer.preferenceTags.set('[email protected]', ['weekly-digest'])

// Add preference tags
client.customer.preferenceTags.add('[email protected]', ['promotions'])

// Remove preference tags
client.customer.preferenceTags.remove('[email protected]', ['promotions'])

Email Lists

Get All Lists

client.lists.get()

Create a List

client.lists.add('My New List')

// Or with additional options
client.lists.add({ name: 'My New List' })

List Contacts

// Get contacts in a list
client.lists.contacts('listId').get()

// With pagination
client.lists.contacts('listId').get(2) // page 2

// Add contact to list
client.lists.contacts('listId').add('[email protected]')

// Remove contact from list
client.lists.contacts('listId').remove('[email protected]')

Journeys

Trigger webhook event waits in journeys.

client.journeys('journeyId').nodes('nodeId').webhook('[email protected]')

// With additional data
client.journeys('journeyId').nodes('nodeId').webhook({
  email: '[email protected]',
  customer_data: { /* ... */ },
  session_data: { /* ... */ },
})

Segments

Get Customers in Segment

client.segments.customers('segmentId').get()

Sessions

Update session data after conversion.

client.sessions.update('sessionId', {
  paymentDate: new Date(),
  fulfillmentDate: new Date(),
  deliveryDate: new Date(),
  metadata: {
    tracking_number: '1Z999AA10123456784',
  },
})

All date fields are optional and accept Date objects or date strings.

API Versions

Some features require API v2:

| Feature | API v1 | API v2 | |---------|--------|--------| | customer.getByPhone() | - | Yes | | customer.tags.* | - | Yes |

Set the API version when creating the client:

const client = new Rejoiner({
  siteId: 'yourSiteId',
  apiKey: 'yourApiKey',
  apiVersion: 2,
})