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

# Authentication

> Configure your Paubox API credentials for the PHP SDK.

## Obtain your credentials

The Email API client requires two credentials:

* **API key**: a secret token that authenticates your requests
* **Username**: your Paubox API endpoint username (not your login email)

Both are available in the [Paubox dashboard](https://next.paubox.com) under **API Credentials**.

## Create a .env file

Add your credentials to a `.env` file at your project root:

```bash theme={null}
PAUBOX_API_KEY=YOUR_API_KEY
PAUBOX_API_USER=YOUR_USERNAME
```

The SDK reads these variables automatically on instantiation — no constructor arguments are needed:

```php theme={null}
$paubox = new Paubox\Paubox();
```

The SDK sets the `Authorization` header on every request:

```
Authorization: Token token=YOUR_API_KEY
```

## Forms client

`Paubox\PauboxForms` requires no credentials. Form submissions are associated with the form ID, not an API key.

```php theme={null}
$forms = new Paubox\PauboxForms();
```

## Security notes

* Never commit `.env` files to source control. Add `.env` to your `.gitignore`.
* The SDK does not expose credentials in error messages or logs.
