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

@bagdock/loyalty

v0.1.5

Published

Bagdock Loyalty TypeScript SDK — referrals, rewards, and points

Readme

  ----++                                ----++                    ---+++     
  ---+++                                ---++                     ---++      
 ----+---     -----     ---------  --------++ ------     -----   ----++----- 
 ---------+ --------++----------++--------+++--------+ --------++---++---++++
 ---+++---++ ++++---++---+++---++---+++---++---+++---++---++---++------++++  
----++ ---++--------++---++----++---++ ---++---++ ---+---++     -------++    
----+----+---+++---++---++----++---++----++---++---+++--++ --------+---++   
---------++--------+++--------+++--------++ -------+++ -------++---++----++  
 +++++++++   +++++++++- +++---++   ++++++++    ++++++    ++++++  ++++  ++++  
                     --------+++                                             
                       +++++++                                               

@bagdock/loyalty

The official TypeScript SDK for the Bagdock Loyalty API — referrals, rewards, and points for self-storage operators.

npm version License: MIT

Install

npm install @bagdock/loyalty
yarn add @bagdock/loyalty
pnpm add @bagdock/loyalty
bun add @bagdock/loyalty

Quick start

import { BagdockLoyalty } from '@bagdock/loyalty'

const loyalty = new BagdockLoyalty({
  apiKey: 'sk_live_...',
})

// Create a member
const member = await loyalty.members.create({
  email: '[email protected]',
  name: 'Jane Doe',
})

// Create a referral link
const link = await loyalty.links.create({
  memberId: member.id,
  campaignId: 'camp_summer2026',
})

// Track an event
await loyalty.events.track({
  memberId: member.id,
  event: 'booking_completed',
  properties: { unitSize: '10x10' },
})

Platform partners

For platforms embedding loyalty on behalf of operators:

const platform = new BagdockLoyalty({
  apiKey: 'pak_live_...',
})

const operatorClient = platform.forOperator('opreg_wisestorage')
const members = await operatorClient.members.list()

API reference

loyalty.members

| Method | Description | |--------|-------------| | members.create(params) | Create a member | | members.get(id) | Get a member by ID | | members.update(id, params) | Update a member | | members.list(params?) | List members |

loyalty.links

| Method | Description | |--------|-------------| | links.create(params) | Create a referral link | | links.get(id) | Get a link | | links.list(params?) | List links |

loyalty.events

| Method | Description | |--------|-------------| | events.track(params) | Track a loyalty event | | events.list(params?) | List events |

loyalty.enrollments

| Method | Description | |--------|-------------| | enrollments.create(params) | Enroll a member in a program | | enrollments.get(id) | Get enrollment details | | enrollments.list(params?) | List enrollments |

loyalty.subscriptions

| Method | Description | |--------|-------------| | subscriptions.create(params) | Create a subscription | | subscriptions.cancel(id) | Cancel a subscription | | subscriptions.list(params?) | List subscriptions |

loyalty.embedTokens

| Method | Description | |--------|-------------| | embedTokens.create(params) | Create an embed token | | embedTokens.validate(token) | Validate a token | | embedTokens.list(params?) | List tokens |

loyalty.domains

| Method | Description | |--------|-------------| | domains.create(params) | Add a custom domain | | domains.verify(id) | Verify a domain | | domains.list(params?) | List domains |

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | — | Required. Your Bagdock API key | | baseUrl | string | https://api.bagdock.com | API base URL |

License

MIT