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

@resira/sdk

v0.2.7

Published

TypeScript SDK for the Resira public reservation API

Readme

@resira/sdk v0.2.6

TypeScript SDK for the Resira public reservation API.

Version history lives in CHANGELOG.md.

Installation

npm install @resira/[email protected]

Quick start

import { Resira } from "@resira/sdk";

const resira = new Resira({
  apiKey: "resira_live_your_api_key_here",
});

Client config

const resira = new Resira({
  apiKey: "resira_live_your_api_key_here",
  maxRetries: 3,
  retryBaseDelay: 500,
});

| Option | Type | Default | Description | | --- | --- | --- | --- | | apiKey | string | required | Public Resira API key | | baseUrl | string | unset | Pin all SDK requests to one origin | | baseUrls | Array<string \| { url: string; weight?: number }> | unset | Explicit client-side routing override | | maxRetries | number | 3 | Retry attempts for 429 and 5xx responses | | retryBaseDelay | number | 500 | Base exponential backoff delay in ms | | fetch | typeof fetch | globalThis.fetch | Custom fetch implementation |

Routing behavior

  • The SDK keeps a browser session sticky to the selected origin.
  • Ambient host-app env vars such as NEXT_PUBLIC_API_URL are ignored.
  • Only explicit SDK config via baseUrl or baseUrls overrides the default routing behavior.
  • In development, the SDK defaults to http://localhost:3001.

Core methods

resira.getConfig()

Fetch non-sensitive public property config such as Stripe publishable key, deposit percentage, currency, and branding.

const config = await resira.getConfig();
console.log(config.stripePublishableKey);

resira.validatePromoCode(code)

const promo = await resira.validatePromoCode("SUMMER20");
if (promo.valid) {
  console.log(promo.discountType, promo.discountValue);
}

resira.getAvailability(resourceId, params?)

const availability = await resira.getAvailability("prop-1", {
  startDate: "2026-07-01",
  endDate: "2026-07-07",
});
const slots = await resira.getAvailability("table-5", {
  date: "2026-07-01",
  partySize: 4,
});

resira.listResources()

const { resources } = await resira.listResources();

resira.listProducts()

const { products } = await resira.listProducts();

resira.createPaymentIntent(payload, options?)

const paymentIntent = await resira.createPaymentIntent({
  productId: "prod-123",
  resourceId: "res-456",
  partySize: 2,
  startDate: "2026-07-01",
  startTime: "2026-07-01T10:00:00Z",
  endTime: "2026-07-01T11:00:00Z",
  guestName: "Jane Doe",
  guestEmail: "[email protected]",
});

resira.confirmPayment(payload)

const confirmation = await resira.confirmPayment({
  paymentIntentId: "pi_xxx",
  reservationId: "res_123",
});

resira.createReservation(payload, options?)

Creates a reservation via the public booking flow. An idempotency key is automatically generated unless you pass one explicitly.

const { reservation } = await resira.createReservation({
  resourceId: "prop-1",
  guestName: "Jane Doe",
  guestEmail: "[email protected]",
  startDate: "2026-07-01",
  endDate: "2026-07-07",
  partySize: 3,
});

resira.listReservations(resourceId, params?)

const page = await resira.listReservations("prop-1", {
  status: "confirmed",
  page: 1,
  limit: 50,
});

resira.getReservation(resourceId, reservationId)

const result = await resira.getReservation("prop-1", "res-uuid");

Error handling

All SDK errors extend ResiraError.

import {
  ResiraApiError,
  ResiraNetworkError,
  ResiraRateLimitError,
} from "@resira/sdk";

try {
  await resira.createReservation(payload);
} catch (error) {
  if (error instanceof ResiraRateLimitError) {
    console.log(error.retryAfter);
  } else if (error instanceof ResiraApiError) {
    console.log(error.status, error.message);
  } else if (error instanceof ResiraNetworkError) {
    console.log(error.message);
  }
}

| Error class | Meaning | | --- | --- | | ResiraRateLimitError | 429 response after retry handling | | ResiraApiError | Non-2xx API response | | ResiraNetworkError | Network/DNS/TLS failure |

Requirements

  • Node.js >= 18
  • No runtime dependencies

Release notes

See CHANGELOG.md for release-by-release details.