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

# Install

> Install the Pepay SDK for Node.js and browser environments.

## Overview

Install `pepay` to access Pepay APIs via a typed client and resource groups (invoices, tokens, commerce, events, websockets).

## Authentication

You’ll need API credentials to make authenticated requests:

* Merchant server: `PEPAY_API_KEY` (maps to `x-api-key`)
* Commerce server: `PEPAY_COMMERCE_API_KEY` (maps to `x-commerce-api-key`)
* Payor/browser: session token + signature (returned by invoice creation)

## Request

### Requirements

* Node.js 18+ (recommended for server integrations)
* Evergreen browsers for client integrations (payor/session flows only)

### Install

```bash theme={null}
npm install pepay
```

### Import (TypeScript / ESM)

```ts theme={null}
import { Pepay } from 'pepay';
```

### Import (CommonJS)

```js theme={null}
const { Pepay } = require('pepay');
```

## Response

After install, you can construct a client and call resources:

```json theme={null}
{
  "client": "Pepay",
  "resources": ["invoices", "tokens", "commerce", "events", "ws"],
  "defaults": {
    "baseUrl": "https://api-beta.pepay.io",
    "maxRetries": 2
  }
}
```

## Errors

* `ERR_MODULE_NOT_FOUND` / import errors: ensure Node 18+ and a compatible module system (ESM vs CommonJS).
* Network/auth errors at runtime: verify credentials and base URL configuration.

## Examples

Minimal client:

```ts theme={null}
import { Pepay } from 'pepay';

const pepay = new Pepay({ apiKey: process.env.PEPAY_API_KEY! });
```

Next: [Configure](/sdk/configure)
