Pandabase
SDKs

TypeScript

Call the Pandabase API from TypeScript or JavaScript.

This guide is a work in progress.

Use the TypeScript SDK to call the Pandabase API from your server.

Installation

Install the package with:

npm install @pandabase/node

Usage

Configure the client with your store ID and API key from the dashboard.

import { Pandabase } from "@pandabase/node";

const pandabase = new Pandabase({
  storeId: "shp_",
  apiKey: "sk_...",
});

await pandabase.checkouts.create({
  items: [
    {
      name: "Product A",
      quantity: 1,
      amount: 1000, // $10.00 USD
    },
  ], // https://docs.pandabase.io/api-reference/checkouts/create-checkout-session#body-items
  customer: {
    email: "joe@gmail.com",
  },
});

await store.checkouts.estimate({}); // same API as above just returns a preview

Last updated on

On this page