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

# SDKs Overview

> Explore EngageFabric SDKs and client libraries. Choose from JavaScript, React, Python, or direct REST API integration for your platform.

EngageFabric provides official SDKs to simplify integration with your applications.

<Note>
  SDKs are currently available for enterprise customers and early access partners.
  Contact us at [support@engagefabric.com](mailto:support@engagefabric.com) to get access.
</Note>

## Available SDKs

<CardGroup cols={2}>
  <Card title="JavaScript SDK" icon="js" href="/sdks/javascript">
    Full-featured SDK for Node.js and browser environments
  </Card>

  <Card title="React Components" icon="react" href="/sdks/react">
    Pre-built UI components for React applications
  </Card>
</CardGroup>

***

## Installation

<Tabs>
  <Tab title="JavaScript SDK">
    ```bash theme={null}
    npm install @engagefabricsdk/sdk
    ```
  </Tab>

  <Tab title="React Components">
    ```bash theme={null}
    npm install @engagefabricsdk/sdk @engagefabricsdk/react
    ```
  </Tab>
</Tabs>

***

## Integration Methods

Choose the integration method that fits your tech stack:

| Language              | Integration Method       | Install                              |
| --------------------- | ------------------------ | ------------------------------------ |
| JavaScript/TypeScript | `@engagefabricsdk/sdk`   | `npm install @engagefabricsdk/sdk`   |
| React                 | `@engagefabricsdk/react` | `npm install @engagefabricsdk/react` |
| Python                | REST API (requests)      | `pip install requests`               |
| Ruby                  | REST API (net/http)      | Built-in                             |
| PHP                   | REST API (curl)          | Built-in                             |
| cURL                  | Command line             | Built-in                             |

***

## Quick Comparison

| Feature          | JavaScript SDK | React Components |
| ---------------- | -------------- | ---------------- |
| API Calls        | Yes            | Via SDK          |
| WebSocket        | Yes            | Via SDK          |
| State Management | Zustand stores | React hooks      |
| UI Components    | No             | Yes              |
| Server-side      | Yes            | No               |
| Browser          | Yes            | Yes              |

***

## When to Use What

### JavaScript SDK Only

Use the JavaScript SDK alone when:

* Building a Node.js backend
* Using a different frontend framework (Vue, Angular, Svelte)
* Need full control over UI rendering
* Server-side rendering requirements

### React Components

Use React Components when:

* Building a React application
* Want pre-built, styled UI components
* Need quick integration with minimal code
* Want consistent EngageFabric UI patterns

***

## REST API (No SDK Required)

Any language can integrate with EngageFabric via the REST API. You do not need a language-specific SDK -- just make HTTP requests with your API key. This is ideal for Python, Ruby, PHP, Go, Java, or any backend that can make HTTP calls.

The two most common operations are **identifying a player** and **tracking an event**:

### Identify a Player

<CodeGroup>
  ```python Python theme={null}
  import requests

  API_KEY = "ef_live_your-api-key"
  BASE_URL = "https://api.engagefabric.com/api/v1"

  response = requests.post(
      f"{BASE_URL}/players/identify",
      headers={
          "X-API-Key": API_KEY,
          "Content-Type": "application/json"
      },
      json={
          "externalUserId": "user-123",
          "displayName": "John Doe"
      }
  )

  player = response.json()
  print(f"Player ID: {player['id']}")
  ```

  ```ruby Ruby theme={null}
  require "net/http"
  require "json"
  require "uri"

  api_key = "ef_live_your-api-key"
  base_url = "https://api.engagefabric.com/api/v1"

  uri = URI("#{base_url}/players/identify")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri)
  request["X-API-Key"] = api_key
  request["Content-Type"] = "application/json"
  request.body = {
    externalUserId: "user-123",
    displayName: "John Doe"
  }.to_json

  response = http.request(request)
  player = JSON.parse(response.body)
  puts "Player ID: #{player['id']}"
  ```

  ```php PHP theme={null}
  <?php
  $apiKey = "ef_live_your-api-key";
  $baseUrl = "https://api.engagefabric.com/api/v1";

  $ch = curl_init("$baseUrl/players/identify");
  curl_setopt_array($ch, [
      CURLOPT_POST => true,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
          "X-API-Key: $apiKey",
          "Content-Type: application/json"
      ],
      CURLOPT_POSTFIELDS => json_encode([
          "externalUserId" => "user-123",
          "displayName" => "John Doe"
      ])
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  $player = json_decode($response, true);
  echo "Player ID: " . $player["id"] . "\n";
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.engagefabric.com/api/v1/players/identify" \
    -H "X-API-Key: ef_live_your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "externalUserId": "user-123",
      "displayName": "John Doe"
    }'
  ```
</CodeGroup>

### Track an Event

<CodeGroup>
  ```python Python theme={null}
  import requests

  API_KEY = "ef_live_your-api-key"
  BASE_URL = "https://api.engagefabric.com/api/v1"

  response = requests.post(
      f"{BASE_URL}/events",
      headers={
          "X-API-Key": API_KEY,
          "Content-Type": "application/json"
      },
      json={
          "playerId": "player-id",
          "name": "lesson_completed",
          "properties": {
              "courseId": "math-101",
              "score": 95
          }
      }
  )

  print(f"Status: {response.status_code}")
  ```

  ```ruby Ruby theme={null}
  require "net/http"
  require "json"
  require "uri"

  api_key = "ef_live_your-api-key"
  base_url = "https://api.engagefabric.com/api/v1"

  uri = URI("#{base_url}/events")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri)
  request["X-API-Key"] = api_key
  request["Content-Type"] = "application/json"
  request.body = {
    playerId: "player-id",
    name: "lesson_completed",
    properties: {
      courseId: "math-101",
      score: 95
    }
  }.to_json

  response = http.request(request)
  puts "Status: #{response.code}"
  ```

  ```php PHP theme={null}
  <?php
  $apiKey = "ef_live_your-api-key";
  $baseUrl = "https://api.engagefabric.com/api/v1";

  $ch = curl_init("$baseUrl/events");
  curl_setopt_array($ch, [
      CURLOPT_POST => true,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
          "X-API-Key: $apiKey",
          "Content-Type: application/json"
      ],
      CURLOPT_POSTFIELDS => json_encode([
          "playerId" => "player-id",
          "name" => "lesson_completed",
          "properties" => [
              "courseId" => "math-101",
              "score" => 95
          ]
      ])
  ]);

  $response = curl_exec($ch);
  $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  curl_close($ch);

  echo "Status: $httpCode\n";
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.engagefabric.com/api/v1/events" \
    -H "X-API-Key: ef_live_your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "playerId": "player-id",
      "name": "lesson_completed",
      "properties": {
        "courseId": "math-101",
        "score": 95
      }
    }'
  ```
</CodeGroup>

For the full API reference including all available endpoints, see the [API Reference](/api-reference).
For a step-by-step guide to getting started, see the [Quick Start](/quickstart).

***

## Coming Soon

We're working on additional SDKs:

| SDK         | Status  |
| ----------- | ------- |
| Python SDK  | Planned |
| Unity SDK   | Planned |
| iOS SDK     | Planned |
| Android SDK | Planned |

<Info>
  Want to see an SDK for your platform? [Let us know](mailto:support@engagefabric.com)!
</Info>
