> For the complete documentation index, see [llms.txt](https://developers.felt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.felt.com/js-sdk/getting-started.md).

# Getting started

The Felt SDK allows you to control your Felt maps and build powerful, interactive custom applications. You can control many aspects of the Felt UI and map contents, as well as receive notifications of events happening in the map such as clicks, selections, and more.&#x20;

This feature is available to customers on the [Enterprise plan](https://felt.com/pricing). All new accounts automatically include a 7-day trial of Enterprise plan features.

See our [examples](/js-sdk/examples.md) page to explore what you can build with the SDK.

There are two main ways to use the Felt SDK:

1. Extensions
2. Embedded Maps

### Extensions

Write code directly within Felt using our [Extensions](https://help.felt.com/dashboards-and-apps/extensions) feature. Extensions run directly within the Felt environment, giving you immediate access to all SDK functionality without embedding or connection steps.&#x20;

<figure><img src="/files/q5uiHnO9AmvxTq19femN" alt=""><figcaption></figcaption></figure>

When creating an extension, you automatically have access to a [`FeltController`](https://developers.felt.com/js-sdk-api-reference/main/feltcontroller) object with no setup required. This controller provides all the methods you need to interact with your Felt map, including `getViewport`, `createElement`, `setLayerStyle`, and many more.

```javascript
// In a Felt extension, the controller is automatically available
const layers = await felt.getLayers();
const elements = await felt.getElements();

// Listen for map events
felt.onSelectionChange((selection) => {
  console.log('Selection changed:', selection);
});
```

### Embedded Maps

Embed Felt maps in your own applications and control them remotely. This approach requires connecting to a map embed.

#### Installation

Install the SDK using your preferred package manager:

```bash
npm install @feltmaps/js-sdk
```

Create an HTML page with a container element:

```html
<html>
  <body>
    <div id="container"></div>
  </body>
</html>
```

Embed a Felt map in your container element and use the SDK to control it:

```javascript
import { Felt } from "@feltmaps/js-sdk";

const map = await Felt.embed(
  document.querySelector("#container"),
  "FELT_MAP_ID",
);

const layers = await map.getLayers();
const elements = await map.getElements();
```

For more information on how to control a map, see [Controlling maps](https://developers.felt.com/js-sdk/controlling-maps).

#### React Integration

If you are building a React application, you can use the [Felt SDK React Starter Repo](https://github.com/felt/js-sdk-starter-react) to get started quickly.

You can also read our guide on [Integrating with React](/js-sdk/integrating-with-react.md) to learn more about how to use the Felt SDK with React.


---

# 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://developers.felt.com/js-sdk/getting-started.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.
