> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markpdf.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and configure the official Node.js and TypeScript SDK for Markpdf.

# Installation

Use `@markpdf/sdk` when your project runs on Node.js, TypeScript, server routes, workers, CLIs, or any JavaScript runtime where the API key can stay server-side.

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install @markpdf/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @markpdf/sdk
  ```

  ```bash yarn theme={null}
  yarn add @markpdf/sdk
  ```

  ```bash bun theme={null}
  bun add @markpdf/sdk
  ```
</CodeGroup>

## Configure the API key

Set the key in your environment:

```bash theme={null}
MARKPDF_API_KEY=YOUR_API_KEY
```

Then create the client:

```ts theme={null}
import { MarkpdfClient } from "@markpdf/sdk";

const client = new MarkpdfClient();
const markdown = await client.convertFile(fileBytes, "report.pdf", { mode: "fast" });
```

You can also pass the key explicitly in server-only code:

```ts theme={null}
const client = new MarkpdfClient({ apiKey: "YOUR_API_KEY" });
```

<Warning>
  Never put a private API key in browser code. For Next.js, use `@markpdf/nextjs`; for public React, Angular, Svelte, or mobile apps, call your own backend.
</Warning>

## API endpoint

The production API endpoint is:

```text theme={null}
https://api.markpdf.tech
```

You normally do not need to set it manually; the SDK uses the production endpoint by default.

## Next step

Continue with [Quickstart](/docs/sdks/nodejs/quickstart).
