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

@pushary/server

v1.0.0

Published

Pushary Server SDK - Manage subscribers, campaigns, templates, and send notifications

Downloads

46

Readme

@pushary/server

Server-side SDK for Pushary - Manage subscribers, campaigns, templates, and send push notifications from your backend.

Installation

npm install @pushary/server
# or
yarn add @pushary/server
# or
pnpm add @pushary/server
# or
bun add @pushary/server

Quick Start

import { createPusharyServer } from '@pushary/server'

const pushary = createPusharyServer({
  apiKey: process.env.PUSHARY_API_KEY, // Required: pk_xxx.sk_xxx
})

// Send a notification
await pushary.notifications.send({
  title: 'Hello!',
  body: 'Your order has shipped',
  subscriberIds: ['sub_123'],
})

API Key

The server SDK requires your full API key (pk_xxx.sk_xxx) which includes the secret portion. Never expose this in client-side code.

Get your API key from your Pushary Dashboard.

Resources

Subscribers

// List subscribers
const { data, hasMore, nextCursor } = await pushary.subscribers.list({
  limit: 100,
  status: 'active',
})

// Get a subscriber
const subscriber = await pushary.subscribers.get('sub_123')

// Update subscriber
await pushary.subscribers.update('sub_123', {
  tags: ['vip', 'newsletter'],
  externalId: 'user-456',
})

// Delete subscriber
await pushary.subscribers.delete('sub_123')

// Get subscriber count
const count = await pushary.subscribers.count()

Campaigns

// List campaigns
const { data } = await pushary.campaigns.list()

// Create campaign
const campaign = await pushary.campaigns.create({
  name: 'Welcome Campaign',
  title: 'Welcome!',
  body: 'Thanks for subscribing',
  actionUrl: 'https://example.com/welcome',
})

// Send campaign
await pushary.campaigns.send(campaign.id)

// Pause/Resume
await pushary.campaigns.pause(campaign.id)
await pushary.campaigns.resume(campaign.id)

// Get stats
const stats = await pushary.campaigns.stats(campaign.id)

Templates

// List templates
const { data } = await pushary.templates.list()

// Create template
const template = await pushary.templates.create({
  name: 'Order Update',
  title: 'Order {{orderId}} Update',
  body: 'Your order status: {{status}}',
})

// Update template
await pushary.templates.update(template.id, {
  body: 'Your order {{orderId}} is now {{status}}',
})

// Delete template
await pushary.templates.delete(template.id)

Notifications (Direct Send)

// Send to specific subscribers
await pushary.notifications.send({
  title: 'Flash Sale!',
  body: '50% off everything',
  url: 'https://example.com/sale',
  subscriberIds: ['sub_123', 'sub_456'],
})

// Send to external IDs (your user IDs)
await pushary.notifications.send({
  title: 'New Message',
  body: 'You have a new message',
  externalIds: ['user-123'],
})

// Send to subscribers with tags
await pushary.notifications.send({
  title: 'VIP Exclusive',
  body: 'Special offer just for you',
  tags: ['vip'],
})

TypeScript

Full TypeScript support with exported types:

import {
  createPusharyServer,
  type Subscriber,
  type Campaign,
  type Template,
  type SendNotification,
} from '@pushary/server'

License

MIT