> For the complete documentation index, see [llms.txt](https://docs.forepaas.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.forepaas.org/advanced/sdks.md).

# SDKs

While we're developing official SDKs for various languages, we provide complete reference implementations you can use immediately in your projects.

> **Get Started Fast:** Our reference implementations include everything you need - authentication, error handling, and all endpoints. Just copy the client class and start coding!

## Available SDKs

### Node.js SDK ✅

A complete Node.js client implementation with authentication, error handling, and all endpoint methods.

{% content-ref url="/pages/BLtr8ip2Yn3d2Kq2qjFZ" %}
[Code Examples](/advanced/code-examples.md)
{% endcontent-ref %}

**Features:**

* ✅ Automatic RSA-SHA256 signature generation
* ✅ JWT token management
* ✅ All REST API endpoints covered
* ✅ TypeScript compatible
* ✅ Error handling with retry logic

**Installation:**

```bash
npm install node-fetch
# Copy the ForegateClient class from Code Examples
```

**Quick Start:**

```javascript
const ForegateClient = require('./foregate-client');

const client = new ForegateClient(
  'your-api-key',
  privateKeyPem
);

// Authenticate user
const user = await client.authorizeUser('user123', 'user@example.com');

// Get markets
const markets = await client.getMarkets({ page: 1, pageSize: 10 });
```

### Python SDK ✅

A complete Python client implementation with asyncio support and comprehensive error handling.

{% content-ref url="/pages/BLtr8ip2Yn3d2Kq2qjFZ" %}
[Code Examples](/advanced/code-examples.md)
{% endcontent-ref %}

**Features:**

* ✅ Automatic RSA-SHA256 signature generation
* ✅ JWT token management
* ✅ All REST API endpoints covered
* ✅ Type hints included
* ✅ Exception handling

**Installation:**

```bash
pip install requests cryptography
# Copy the ForegateClient class from Code Examples
```

**Quick Start:**

```python
from foregate_client import ForegateClient

client = ForegateClient(
    api_key='your-api-key',
    private_key_pem=private_key_pem
)

# Authenticate user
user = client.authorize_user('user123', 'user@example.com')

# Get markets
markets = client.get_markets(page=1, pageSize=10)
```

## WebSocket Client

For real-time market data, we provide WebSocket client implementations:

{% content-ref url="/pages/DsnRQsp4Y0IYOY9vuYpI" %}
[WebSocket API](/advanced/websocket-api.md)
{% endcontent-ref %}

## OpenAPI Specification

Download our OpenAPI 3.0 specification to generate clients in any language:

{% file src="/files/5MOm3p5RkCwChISqy4Ij" %}
OpenAPI 3.0 Specification
{% endfile %}

**Generate a client:**

```bash
# Using OpenAPI Generator
npx @openapitools/openapi-generator-cli generate \
  -i openapi.yaml \
  -g typescript-fetch \
  -o ./generated-client

# Using Swagger Codegen
swagger-codegen generate \
  -i openapi.yaml \
  -l python \
  -o ./python-client
```

## Community SDKs

| Language | Maintainer | Repository  | Status         |
| -------- | ---------- | ----------- | -------------- |
| Go       | Community  | Coming soon | 🚧 In Progress |
| Ruby     | Community  | Coming soon | 📋 Planned     |
| Java     | Community  | Coming soon | 📋 Planned     |
| PHP      | Community  | Coming soon | 📋 Planned     |

{% hint style="info" %}
**Contribute:** Interested in building an SDK for your favorite language? Contact us at <support@forepaas.org>
{% endhint %}

## SDK Support

For issues or questions about the SDKs:

1. Check the [Code Examples](/advanced/code-examples.md) for complete implementations
2. Review the [Error Handling](/getting-started/error-handling.md) guide
3. Contact <support@forepaas.org>

## Migration Guide

If you're upgrading from a previous version or custom implementation:

<details>

<summary><strong>Migrating from Custom Implementation</strong></summary>

1. **Replace signature generation** with the SDK's built-in method
2. **Update error handling** to use the SDK's error classes
3. **Migrate JWT management** to use the SDK's automatic token handling
4. **Test thoroughly** in development environment before deploying

See our [Code Examples](/advanced/code-examples.md) for complete migration examples.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.forepaas.org/advanced/sdks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
