# TypeScript (/developers/sdks/typescript)



<Callout type="warn">
  This guide is a work in progress.
</Callout>

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

## Installation [#installation]

Install the package with:

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```sh
    npm install @pandabase/node
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```sh
    pnpm add @pandabase/node
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```sh
    bun add @pandabase/node
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Usage [#usage]

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

```ts
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
```
