> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/client-side-sdk/recart-on-site-methods.md).

# Recart on-site methods

Documents the public methods on the window.\_recart object for controlling opt-in tools on your site.

These methods are available on the global Recart object via `window._recart`.

### `Public methods`

#### isReady

```typescript
isReady(): boolean
```

#### showOptinTool

```typescript
/*
 * triggers the optin tool to show up (currently only handles popups)
 * @param {string} optinToolId - The id of the optin tool to show
 * @param [options] options - Options
 * @param [options.force] - when force is true it shows the popup even if another popup is already visible
 */
showOptinTool(optinToolId: string, options?: { force: boolean }): void
```

#### getActiveOptinToolInExperiment

```typescript
/*
 * returns the optin tool that has been evaluated active in the experiment
 * @param {string} experimentId - The id of the experiment to query
 * @returns {string | null} returns the id of the evaluated optin tool or returns null when no data found
 */
getActiveOptinToolInExperiment(experimentId: string): string | null
```

#### isSubscriberIdentified

```typescript
/*
 * checks if we have already identified the visitor as a subscriber
 * @returns {boolean} Returns true if the visitor has filled out any of the optin tools
 */
isSubscriberIdentified(): boolean
```

#### hasSubscribedToOptinTool

```typescript
/*
 * checks if the visitor has subscribed to a specific optin tool
 * @param {string} optinToolId - The id of the optin tool to check
 * @returns {boolean} Returns true if the visitor has filled out the specified optin tool
 */
hasSubscribedToOptinTool(optinToolId: string): boolean
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.recart.com/developers/client-side-sdk/recart-on-site-methods.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
