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

@simplr-ai/node

v2.0.0

Published

Simplr server-side SDK for Node.js — fraud/identity checks, order scoring, edge ingestion, and webhook signature verification.

Readme

@simplr-ai/node

Simplr's server-side SDK for Node.js — run fraud/identity checks, score orders, ingest edge logs, and verify webhook signatures, all with your secret key.

This is the backend SDK. For client-side device signals, RUM, and feature-flag evaluation use @simplr-ai/js (browser) or simplr_fraud (Flutter).

Docs: https://simplr-docs-three.vercel.app/sdks/node

Install

npm install @simplr-ai/node

Requires Node 18+ (uses the built-in fetch and crypto).

Quick start

import { Simplr } from "@simplr-ai/node";

const simplr = new Simplr({ apiKey: process.env.SIMPLR_API_KEY! }); // sk_live_… / sk_test_…

const result = await simplr.check({ email: "[email protected]", event_type: "signup" });
if (result.risk_level === "high" || result.risk_level === "critical") {
  // require extra verification
}

baseUrl defaults to https://api.simplr-ai.com; override it for local/dev:

new Simplr({ apiKey: "sk_test_…", baseUrl: "http://localhost:7002" });

Checks

await simplr.check({ phone: "+14155550100", event_type: "login" });
await simplr.checkBulk([{ email: "[email protected]" }, { phone: "+1..." }]); // up to 100

Orders

await simplr.orders.submit({ order_id: "o_1", external_id: "cust_1", amount: 249, currency: "USD" });
await simplr.orders.submitBulk([/* up to 100 orders */]);

Phone intelligence

await simplr.phone.report({ phone: "+14155550100", outcome: "sim_swap_fraud", confidence: 0.9 });
await simplr.phone.intelligence("+14155550100");

Edge devices & logs

await simplr.edge.registerDevice({ device_id: "POS-0042", name: "Front till" });
await simplr.edge.heartbeat("POS-0042", { cpu: 0.34, battery: 0.78 });
await simplr.edge.ingestLogs("POS-0042", [{ category: "transaction", level: "info", message: "sale ok" }]);

Webhooks

Verify the X-Simplr-Signature header against the raw request body (don't re-serialize parsed JSON):

import express from "express";
import { Simplr } from "@simplr-ai/node";

const simplr = new Simplr({ apiKey: process.env.SIMPLR_API_KEY! });
const app = express();

app.post("/hooks/simplr", express.raw({ type: "application/json" }), (req, res) => {
  const sig = req.header("X-Simplr-Signature")!;
  try {
    const event = simplr.webhooks.constructEvent(req.body, sig, process.env.SIMPLR_WEBHOOK_SECRET!);
    // event.event, event.data
    res.sendStatus(200);
  } catch {
    res.sendStatus(400); // invalid signature
  }
});

verify(payload, header, secret, { toleranceSec }) returns a boolean; constructEvent(...) returns the parsed event or throws WebhookVerificationError.

Server-side feature flags

Evaluate flags on the backend. Flag config is read with a public key (pk_…), so pass one alongside your secret key; evaluation is local and deterministic (same bucketing as the browser SDK).

const simplr = new Simplr({
  apiKey: process.env.SIMPLR_API_KEY!,       // sk_… for checks/orders/etc.
  publicKey: process.env.SIMPLR_PUBLIC_KEY!, // pk_… for flags
});

await simplr.flags.initialize();
simplr.flags.setUser("user_123");

if (simplr.flags.isEnabled("new-checkout")) {
  // gate a backend code path
}
simplr.flags.isEnabled("beta", { userId: "u1", attributes: { plan: "growth" } });

Targeting a named environment

environment accepts a named environment slug (e.g. "dev", "uat", "prod") as well as the legacy "live"/"test" key modes. When omitted, the API falls back to the public key's own live/test mode.

// On the Simplr client (forwarded to simplr.flags):
const simplr = new Simplr({ apiKey, publicKey, environment: "uat" });

// Or standalone:
import { SimplrFlags } from "@simplr-ai/node";
const flags = new SimplrFlags({ publicKey, environment: "uat" });
await flags.initialize();

You can also use SimplrFlags standalone.

Profiles (simplr.profiles)

Anonymous user profiles + order fraud monitoring. Identify a user, score orders, read a user's risk, and report outcomes back to improve scoring.

// Create/update an anonymous profile and (optionally) link a device.
const { profile, is_new } = await simplr.profiles.identify("user-123", {
  profileType: "customer",
  fingerprintHash: "9f2a…", // from a client device-signal collector
});

// Score an order.
const result = await simplr.profiles.submitOrder({
  order_id: "order-1",
  external_id: "user-123",
  amount: 4999,
  currency: "USD",
});

// Read a user's current risk profile.
const risk = await simplr.profiles.getProfileRisk("user-123");

// Feed back a confirmed outcome (chargeback, manual review, …).
await simplr.profiles.reportOutcome("user-123", "fraud"); // or "legitimate"

RUM (simplr.rum)

Server-side Real User Monitoring. Events are batched and flushed to /v1/rum/events. The flush timer is installed with unref(), so it never keeps your process alive. There is no DOM auto-capture on the server — report views/actions/errors/logs explicitly.

simplr.rum.initialize({ applicationId: "my-api", environment: "production" });

simplr.rum.setUser("user-123", { plan: "pro" });
simplr.rum.addAttribute("region", "eu-west-1");

simplr.rum.trackView("POST /checkout");
simplr.rum.trackAction("charge_card", { gateway: "stripe" });
simplr.rum.log("info", "checkout completed", { orderId: "order-1" });

try {
  // …
} catch (err) {
  simplr.rum.trackError(err as Error);
}

await simplr.rum.flush();        // force a flush
await simplr.rum.stopSession();  // emit session_end, flush, stop timer

AI delegation (simplr.ai)

OAuth-like AI authentication — mint, validate, and revoke delegation tokens that an end user shares with their AI agent.

// Mint a token (only returned once).
const delegation = await simplr.ai.createDelegation({
  userId: "user-123",
  binding: "verified_device",
  expiresInDays: 7,
  fingerprintHash: "9f2a…",
});

// Validate (introspect) an incoming token on your AI gateway.
const check = await simplr.ai.validate(token, { aiProvider: "anthropic", action: "read_orders" });
if (!check.valid) { /* reject */ }

// Manage delegations.
await simplr.ai.list("user-123");
await simplr.ai.get(delegation.delegationId);
await simplr.ai.stats();
await simplr.ai.revoke(delegation.delegationId, "user revoked");
await simplr.ai.revokeAllForUser("user-123", "logout"); // returns count

The browser SDK's interactive connect() popup flow is web-only and is intentionally omitted from the server SDK.

Admin / measurement (SimplrAdmin)

Dashboard operations — usage/measurement, feature-flag CRUD, and RUM analytics — require a portal token (JWT), not an API key:

import { SimplrAdmin } from "@simplr-ai/node";

const admin = new SimplrAdmin({ token: process.env.SIMPLR_PORTAL_TOKEN! });

await admin.usage.stats(orgId);     // usage counters
await admin.usage.billing(orgId);   // per-service totals + estimated cost (API measurement)
await admin.flags.create(orgId, { key: "new-checkout", environment: "test", rollout_percentage: 10 });
await admin.flags.update(orgId, flagId, { rollout_percentage: 50 });
await admin.rum.overview(orgId, { application_id: "my-app" });
await admin.rum.sessions(orgId, { page: 1, limit: 50 });

Errors

Non-2xx responses throw SimplrError with .status and .body.

License

Commercial software — see LICENSE.