> For the complete documentation index, see [llms.txt](https://help.blings.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.blings.io/role-guides/developer/getting-started/how-to-connect-my-data-to-the-sdk/custom-api-integration.md).

# Custom API Integration

Use a custom API or SDK integration when personalization depends on runtime data from your own systems, such as authenticated user state, product usage, CDP enrichment, account data, recommendations, pricing, eligibility, or backend decisioning.

This path gives the implementation team full control over what data is fetched, transformed, and passed into the MP5 player.

Start in Platform Integration to collect the project-specific SDK and field details:

{% content-ref url="/pages/x3JPpFV8w1i0Dwwm10bj" %}
[Integration](/apps/blings-platform/integration.md)
{% endcontent-ref %}

Use Simulation separately when you need to preview backend states before connecting the API.

{% content-ref url="/pages/VkH17x1J2SH1VmvzEgwU" %}
[Simulation](/apps/blings-platform/simulation.md)
{% endcontent-ref %}

## When to Use a Custom API

* Personalization should use secure backend logic.
* Data should not appear in the URL.
* Multiple internal systems need to be combined before render.
* The MP5 is embedded in an authenticated website, product, portal, or app.
* The experience needs live context such as account status, product state, availability, location, device state, or eligibility.
* The implementation team wants to own hosting, routing, analytics wrappers, consent controls, or page behavior.

<figure><img src="/files/EyYX5wvPe9QwRCykruVl" alt="Custom API integration passing backend data into the Blings SDK" width="329"><figcaption><p>Custom API data passed into the Blings SDK.</p></figcaption></figure>

## Implementation Flow

{% stepper %}
{% step %}

### Confirm the MP5 Field Schema

In Platform, open **Settings -> Dynamic Data** and record the exact field names, expected value types, and required fields.
{% endstep %}

{% step %}

### Simulate the Important States

Create Simulation profiles that match the backend states your API will return, such as eligible, ineligible, premium, expired, missing image, or alternate offer.
{% endstep %}

{% step %}

### Copy SDK Details from Platform

Open **Integration** and copy the project-specific SDK or custom code instructions. Confirm the project ID, selected lineup or scene path, and any player settings required by the project.
{% endstep %}

{% step %}

### Fetch or Assemble Data

Use your application or backend to fetch the viewer data, normalize it to the MP5 field schema, and apply fallback logic before initializing the player.
{% endstep %}

{% step %}

### Pass Data into the Player

Initialize the Blings player with the JSON payload and test it against the same values used in Simulation.
{% endstep %}
{% endstepper %}

## Example

```js
fetch("https://my-api.example.com/user-data/123")
  .then((response) => response.json())
  .then((userData) => {
    BlingsPlayer.create({
      project: {
        id: "project-id-from-platform"
      },
      settings: {
        container: document.getElementById("blings-video-container")
      },
      data: userData
    });
  });
```

The `userData` keys must match the field names in the Blings project schema.

```json
{
  "first_name": "Jordan",
  "plan": "Premium",
  "recommended_offer": "travel-upgrade",
  "profile_image": "https://example.com/jordan.jpg"
}
```

## QA Checklist

* The API response maps exactly to the Dynamic Data field names.
* Sensitive values are handled according to the customer's privacy and security requirements.
* Missing values return defaults that the MP5 can render safely.
* Image, audio, and video URLs are accessible from the viewer's device.
* The page is tested with the same states used in Platform Simulation.
* Analytics and event handling are tested in the hosting page or app.

## Related Guides

{% content-ref url="/pages/oNeRtfOObG8V08dUeRby" %}
[Getting Started with Blings.io Dynamic Video SDK](/role-guides/developer/getting-started/getting-started-with-blings.io-dynamic-video-sdk.md)
{% endcontent-ref %}

{% content-ref url="/pages/nqdyYYGZ0P0Sn0b8SzjT" %}
[Embedding Blings MP5 Videos in Mobile Apps](/role-guides/developer/getting-started/advanced-topics/webview-integration.md)
{% endcontent-ref %}


---

# 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, and the optional `goal` query parameter:

```
GET https://help.blings.io/role-guides/developer/getting-started/how-to-connect-my-data-to-the-sdk/custom-api-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
