> ## Documentation Index
> Fetch the complete documentation index at: https://speakeasy-20cf8bdf.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> TypeScript SDK for Dub

## Install

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install dub
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add dub zod # zod is a peer dependency
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add dub 
    ```
  </Tab>
</Tabs>

## Options

The SDK constructor accepts an options object with the following properties:

<ParamField body="token" type="string" required>
  The API token for the Dub API. You can create your token from the [Dub
  dashboard](https://app.dub.co/settings/tokens).
</ParamField>

## Usage

```typescript theme={null}
import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
});

await dub.links.create({
  url: "https://google.com",
});
```
