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

@estackly/storefront

v0.1.0

Published

Typed client for the Estackly Storefront API: catalogue, carts, checkout links, customer accounts and webhooks.

Readme

@estackly/storefront

A small, typed client for the Estackly Storefront API: catalogue, carts, checkout links, customer accounts and webhooks. No dependencies; works in browsers, Node 18+, Deno, Bun and edge runtimes.

npm install https://developers.estackly.com/starters/estackly-storefront-0.1.0.tgz

The package installs under its own name, so imports stay @estackly/storefront.

Quick start

import { createStorefrontClient } from "@estackly/storefront";

const estackly = createStorefrontClient({
  publicKey: process.env.ESTACKLY_PUBLIC_KEY!, // esk_pub_… from admin → Settings → Developers
  currency: "USD",                              // optional: one of the store's selling currencies
});

const { data: products, page } = await estackly.products.list({ sort: "newest", limit: 24 });
const product = await estackly.products.bySlug("linen-shirt");
const store = await estackly.store();

Every price is a Money object: { amount_minor, currency, formatted }. Show formatted; do sums on amount_minor.

Cart and checkout

const cart = await estackly.carts.create([{ product_id: 137, variant_id: 37, quantity: 1 }]);
const ref = { id: cart.id, token: cart.token }; // keep both; the token is returned only once

await estackly.carts.addLine(ref, { product_id: 94, variant_id: 2 });
await estackly.carts.applyCoupon(ref, "WELCOME10");

const { checkout_url } = await estackly.carts.checkout(ref);
window.location.href = checkout_url; // the store's own checkout, valid one hour, one use

Payment, tax and shipping always run on the store's checkout, so your code never touches card data.

Shopper accounts

const { customer_access_token } = await estackly.customers.login(email, password);
const shopper = estackly.withCustomer(customer_access_token);

const orders = await shopper.customers.orders.list();
const wishlist = await shopper.customers.wishlist.get();

Create carts with shopper.carts.create(...) and they are recorded against the shopper's account.

Errors

Failed calls throw EstacklyError with status, code (for example out_of_stock, coupon_invalid, cart_changed), message, fields for validation errors and requestId. A 429 is retried automatically after Retry-After (up to two times; set maxRetries).

import { EstacklyError } from "@estackly/storefront";

try {
  await estackly.carts.applyCoupon(ref, code);
} catch (e) {
  if (e instanceof EstacklyError && e.code === "coupon_invalid") showMessage(e.message);
  else throw e;
}

Webhooks (server only)

import { createStorefrontClient, verifyWebhook } from "@estackly/storefront";

const admin = createStorefrontClient({ privateKey: process.env.ESTACKLY_PRIVATE_KEY! });
const hook = await admin.webhooks.create("https://example.com/estackly", ["order.paid", "order.shipped"]);
// store hook.secret; it is shown only once

// In your handler, verify against the raw body:
const event = await verifyWebhook(rawBody, req.headers["estackly-signature"], process.env.ESTACKLY_WEBHOOK_SECRET!);
if (event.topic === "order.paid") { /* … */ }

Never put a private key (esk_prv_…) in browser or app code.

All methods

| Area | Methods | | --- | --- | | Key | key() | | Catalogue | products.list / all / get / bySlug / related / reviews, categories.list / get, brands.list | | Content | store(), menu("main" \| "footer"), pages.list / get, banners(placement?) | | Cart | carts.create / get / addLine / updateLine / removeLine / applyCoupon / removeCoupon / estimateShipping / checkout | | Customers | customers.register / login / logout / me / update / changePassword, customers.addresses.*, customers.orders.list / get, customers.wishlist.get / set | | Webhooks | webhooks.list / create / update / remove / deliveries / test, verifyWebhook() |

The full reference is at developers.estackly.com/reference.

License

MIT