# Write your own

{% hint style="success" %}
This is the official documentation of the `@forestadmin/agent` Node.js agent.
{% endhint %}

Custom data sources are the answer to the need to import collections from either your in-house APIs, unsupported databases or SaaS providers.

Forest Admin is built so that it does not need to know the nature of the data source it is speaking to, as long as it exposes a given interface.

That interface is only there to abstract away differences between backends so that they can be used as Forest Admin collections. It was built to allow for the minimal feature set which allows Forest Admin to work.

## Getting started

When creating a custom data source, you can use either the "Query Translation" or "Replication" strategy:

| -                | Replication connector                                                            | Query translation connector                                                         |
| ---------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Recommended for  | APIs with limited capabilities.                                                  | Databases or APIs with advanced query capabilities.                                 |
| How does it work | Maintains a copy of all the data in the target API, and use it for read queries. | The data source translates all Forest Admin queries to the target API in real time. |
| Preconditions    | Target API is capable of exporting all data.                                     | Target API is capable of expressing filters, aggregating data, ...                  |


---

# Agent Instructions: 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.forestadmin.com/developer-guide-agents-nodejs/data-sources/custom.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.
