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

@crablr/admin

v0.3.4

Published

Administrative API client for the Crablr platform, providing backend management capabilities and administrative operations.

Readme

@crablr/admin

Official Node.js SDK for the Crablr payment platform. Create payment intents and verify webhook signatures in your server-side applications.

Installation

npm install @crablr/admin

Quick Start

import { createCrablrAdmin, createWebhook } from "@crablr/admin";

// Initialize the admin client
const crablr = createCrablrAdmin({
  apiKey: "as_your_admin_secret_key_here",
});

// Create a payment intent
const paymentIntent = await crablr.createPaymentIntent({
  price: { currency: "usd", amount: 29.99 }, // $29.99
  metadata: { orderId: "order_123" }, // Optional
});

console.log(paymentIntent.id); // Payment intent ID
console.log(paymentIntent.clientSecret); // Secret for client

// Handle webhooks
const webhook = createWebhook({
  webhookSecret: "whs_your_webhook_secret_here",
});

const paymentIntentId = webhook.assertSignature(
  req.body, // Payload
  req.headers["x-crablr-hmac-sha256"], // Signature
);

API Reference

Admin Client

createCrablrAdmin(options)

Initialize an authenticated Crablr admin client.

const crablr = createCrablrAdmin({
  apiKey: "as_your_admin_secret_key_here",
});

Parameters:

  • apiKey (string | function) - Admin secret API key (must start with as_)

Returns: Admin client with methods: createPaymentIntent, getPaymentIntent, createCheckoutSession

Payment Intents

createPaymentIntent(input)

Create a new payment intent for accepting cryptocurrency payments.

const paymentIntent = await crablr.createPaymentIntent({
  price: { currency: "usd", amount: 29.99 }, // $29.99 in USD
  metadata: { orderId: "order_456" }, // Optional
});

console.log(paymentIntent.id); // Use this to track the payment
console.log(paymentIntent); // Send to client for payment execution

getPaymentIntent(input)

Retrieve a specific payment intent by ID.

const paymentIntent = await crablr.getPaymentIntent({
  id: "507f1f77bcf86cd799439011",
});

console.log(paymentIntent.status);

createCheckoutSession(input)

Create a hosted checkout session for streamlined payment flows.

const session = await crablr.createCheckoutSession({
  lines: [
    {
      product: {
        title: "Premium Widget",
        subtitle: "Includes shipping",
      },
      unitPrice: { currency: "usd", amount: 19.99 }, // $19.99
      quantity: 2,
    },
  ],
  successUrl: "https://yoursite.com/orders/success",
  metadata: { orderId: "order_123" }, // Optional
  blurb: "Order summary and details", // Optional
});

console.log(session.url); // Redirect user to this URL

Webhook Handling

createWebhook(options)

Create a webhook handler for verifying webhook signatures.

const webhook = createWebhook({
  webhookSecret: "whs_your_webhook_secret_here",
});

webhook.assertSignature(payload, signature)

Verify webhook signature and validate payload expiration.

try {
  const paymentIntentId = webhook.assertSignature(
    req.body, // Payload
    req.headers["x-crablr-hmac-sha256"], // Signature
  );
  console.log("Webhook verified for payment:", paymentIntentId);
} catch (error) {
  console.error("Webhook verification failed:", error.message);
}

Utilities

parseBody(reqBody)

Parse webhook request body (handles both string and object).

const { paymentIntentId, expiration, payload } = parseBody(req.body);

parseHeaders(headers)

Extract webhook signature from request headers.

const signature = parseHeaders(req.headers); // Gets x-crablr-hmac-sha256

parseReq(req)

Parse complete webhook request (body and headers).

const { body, receivedSignature } = parseReq(req);

Configuration

Get your credentials from the Crablr dashboard:

  • Admin Secret API Key: Starts with as_ - use for server-side operations
  • Webhook Secret: Starts with whs_ - configure in shop settings

Supported Blockchains

  • Solana - SOL, 20,000+ SPL tokens
  • Ethereum - ETH, ERC-20 tokens
  • Polygon - MATIC, ERC-20 tokens
  • Base - ETH, ERC-20 tokens
  • Binance Smart Chain - BNB, BEP-20 tokens

Error Handling

All methods throw descriptive errors:

  • Invalid API key: "Invalid admin secret API key. It must start with as_"
  • Invalid webhook secret: "Invalid webhook secret. It must start with whs_"
  • Expired signature: "Signature is expired."
  • Invalid signature: "Invalid signature."

License

ISC