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

@spaysarldev/notif-auth-node

v0.1.0

Published

Server-side OAuth exchange and JWT verification for Notif Auth

Downloads

118

Readme

Notif Auth — Node.js SDK

Server-side WhatsApp authentication for Notif Auth. Generates OAuth authorization requests with PKCE S256, exchanges authorization codes, and verifies the signed profile using the issuer's public keys.

Version: 0.1.0.

Installation

npm install @spaysarldev/notif-auth-node

Install from source

Requires Node.js 22.12 or newer.

git clone https://github.com/dione24/notif-auth-node.git
cd notif-auth-node
npm ci
npm run check
npm pack

# From your application's directory:
npm install /path/to/notif-auth-node/spaysarldev-notif-auth-node-0.1.0.tgz

npm install github:dione24/notif-auth-node#main also builds the package from GitHub. Pin a reviewed commit instead of main for reproducible production installations.

Configure your application

  1. Create a developer account.
  2. Create a Server application in the dashboard. Verify your email to enable Live; Sandbox remains available.
  3. Register the exact callback URL. Live callbacks require HTTPS. Save the client secret on your server.
import { NotifAuth } from '@spaysarldev/notif-auth-node';

const auth = new NotifAuth({
  clientId: process.env.NOTIF_CLIENT_ID!,
  clientSecret: process.env.NOTIF_CLIENT_SECRET!,
  redirectUri: process.env.NOTIF_REDIRECT_URI!,
  issuer: 'https://auth.notif.ml',
  allowSandbox: false, // Explicitly reject test identities in production.
});

Start a login

const { url, transaction } = auth.begin();
// Save transaction in this browser's server-side session, expiring within
// 5 minutes, or in an authenticated HttpOnly cookie with a short lifetime.
// Then redirect this browser to url.

Never store one shared transaction for all users. The transaction contains state, the PKCE verifier and the callback URL. The SDK does not provide your application's session store.

Handle the callback

// Read code/state from the callback query and retrieve this browser's transaction.
// Reject a missing/expired transaction, then consume it once in your session store.
const profile = await auth.complete(code, state, transaction);

// profile.subject identifies this user in the tenant/environment.
// Look up your own account and create your own secure application session.

complete() validates state before exchanging the code. exchange(code, verifier, redirectUri?) is available for integrations that validate state themselves, such as the React SDK flow. Do not skip that validation.

A profile contains subject, phone_e164, optional display_name, mode, provider, and the signed token. Token verification enforces the issuer, audience, RS256 signature and expiration. Decoding a JWT without verifying it is insufficient.

Existing accounts

Link WhatsApp only from a session already authenticated to the destination account. Require recent reauthentication for sensitive linking or transfers. Do not automatically merge users by name, a supplied email, or a phone number. This SDK verifies a WhatsApp login; account linking, roles, recovery and sessions belong to your application.

Sandbox

Test clients (pk_test_…) allow test profiles by default. Use allowSandbox: true explicitly for Sandbox integrations and false in production. A test profile has mode: 'TEST' and provider: 'sandbox'.

API

  • begin(redirectUri?){ url, transaction }
  • complete(code, state, transaction) → verified profile
  • exchange(code, verifier, redirectUri?) → verified profile (caller validates state)
  • verify(token) → verified JWT claims and profile
  • NotifAuthError exposes code and an optional requestId

Development and support

npm ci
npm run check
npm pack --dry-run

Tests use a local mock issuer and synthetic identities; no live WhatsApp account is needed. See SECURITY.md, publication instructions, and the React SDK.

Support: [email protected]. License: MIT.