> 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

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 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.recart.com/developers/client-side-sdk/recart-on-site-methods.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.
