> For the complete documentation index, see [llms.txt](https://docs.gaming.skillfulai.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gaming.skillfulai.io/web-sdk/getting-started/authentication.md).

# Authentication

Secure access to Skillful AI agents requires proper authentication setup.

### `Getting Your API Key`

1. Sign up at [Skillful AI Dashboard](https://app.skillfulai.io/)
2. Generate your API Key from within your dashboard
3. Use your provided API key for authentication as follows:

### `Setting Up Authentication`

```javascript
const client = new SkillfulClient({
    apiKey: 'your-api-key'
});
```

### `Best Practices`

* Never expose your API key in client-side code
* Use environment variables to store your API key
* Set up proper error handling for authentication failures

#### Using Environment Variables

```javascript
// Using dotenv
require('dotenv').config();

const client = new SkillfulClient({
    apiKey: process.env.SKILLFUL_API_KEY
});
```

### `Authentication Errors`

Common authentication errors and their solutions:

1. **Unauthorized Error**
   * Check if your API key is valid
   * Ensure the API key is correctly formatted
   * Verify your account status
2. **Rate Limiting**
   * Check your current API usage
   * Consider upgrading your plan if needed
   * Implement proper request throttling
