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

@sneekin/sdk

v0.3.2

Published

Node.js SDK for the Sneek Messaging API

Downloads

163

Readme

@sneekin/sdk

Node.js SDK for the Sneek Send API — deliver OTPs and transactional messages over SMS, WhatsApp, and email through Sneek's pre-approved DLT sender, WhatsApp BSP number, and warmed email domain.

Sneek delivers; your app generates and verifies its own OTP codes.

Installation

npm install @sneekin/sdk

Quick start

import { Sneek } from '@sneekin/sdk';

const sneek = new Sneek({
  apiUrl: process.env.SNEEK_API_URL ?? 'https://api.sneek.in',
  apiKey: process.env.SNEEK_API_KEY!, // snk_live_… or snk_test_…
});

// Generic send (body OR template)
await sneek.messages.send({
  to: '+919876543210',
  body: 'Your OTP to login to ConfHub is 482917. Do not share it.',
  channel: 'sms', // 'auto' | 'sms' | 'whatsapp' | 'email'
});

// Channel helpers
await sneek.sendSMS('+919876543210', 'Your code is 482917');
await sneek.sendWhatsApp('+919876543210', 'Your code is 482917');
await sneek.sendEmail('[email protected]', 'Your code is 482917');

// OTP body-formatting helper (you generate the code yourself)
await sneek.sendOTP({
  to: '+919876543210',
  code: '482917',
  appName: 'ConfHub',
  channel: 'auto',
});

// DLT/provider templates (server-rendered)
await sneek.messages.send({
  to: '+919876543210',
  channel: 'sms',
  template: 'otp_login',
  variables: { appName: 'ConfHub', otp: '482917' },
});

Message intent (type)

Declare whether a message is an OTP or a plain communication so Sneek picks the correct approved provider template — instead of guessing from the body text:

// Auth / OTP template
await sneek.messages.send({ to, body: 'Your code is 482917', type: 'otp' });

// Utility / communication template
await sneek.messages.send({
  to,
  body: 'Your booking BK-7781 is confirmed.',
  type: 'transactional',
});

type accepts 'otp' or 'transactional'. When omitted, Sneek infers intent from the body (which can misclassify digit groups like BK-7781 as an OTP), so passing type explicitly is recommended. sendOTP(...) always tags type: 'otp' for you.

Authentication

Every request is sent with Authorization: Bearer <apiKey>. Mint keys from the Sneek admin (/o/<org>/applications/<id> → API keys). Keys are shown once; store them in your environment / secret manager. snk_test_… keys hit dev adapters; snk_live_… keys deliver for real.

Errors & retries

  • Non-2xx responses throw SneekApiError with { status, type, title, detail } (RFC-7807 problem-details).
  • Transient 5xx and network failures are retried with exponential backoff (maxRetries, default 2; retryBaseMs, default 200ms).

Idempotency & rate limits

Pass idempotencyKey to make a send safely repeatable — the first call is processed and its result is replayed for any retry with the same key (per application), so a dropped connection never sends twice. This pairs with the SDK's automatic 5xx retries.

await sneek.messages.send({
  to: '+919876543210',
  type: 'otp',
  body: 'Your code is 482917',
  idempotencyKey: 'order-4815-otp',
});

Sends are rate-limited per application (your plan's per-minute / per-day quota), per recipient, and per source IP. Exceeding a limit throws SneekApiError with status === 429; the problem body carries retry_after (seconds).

import { SneekApiError } from '@sneekin/sdk';

try {
  await sneek.sendSMS('+91…', 'hi');
} catch (err) {
  if (err instanceof SneekApiError && err.status === 401) {
    // invalid / revoked key
  }
}

API

| Method | Description | | --- | --- | | messages.send(input) | Send a message (body or template; optional type intent). Returns 202 accepted envelope. | | messages.get(id) | Fetch a previously-sent message by id. | | sendSMS/sendWhatsApp/sendEmail(to, body, clientRef?) | Channel-pinned helpers. | | sendOTP({ to, code, appName?, channel?, template?, variables? }) | Format + send an OTP body. |

License

UNLICENSED — © Abblor Tech Pvt Ltd.