# Developer overview

> What developers can build with AgentMySite today, including the embed script, the JavaScript API, AgentActions, and mobile WebViews, with links to each guide.

Source: https://agentmysite.com/docs/developers/overview/

AgentMySite adds an AI support assistant to your website. It answers from the content you add, and it can take actions on your site through tools you define. Site owners can install it without writing code. This section is for developers who want to embed it in an app, connect it to their own backend, or review how it works.

## What you can do

| Capability | Status | Where to start |
|---|---|---|
| Embed the widget with one script tag, on any site or single-page app | <StatusBadge status="available" /> | [JavaScript API](/docs/developers/javascript-api/) |
| Label conversations with your signed-in user's ID, name, and email | <StatusBadge status="available" /> | [Script attributes](/docs/developers/javascript-api/#script-attributes) |
| Let the assistant call your code: look up orders, change settings, and more | <StatusBadge status="available" /> | [AgentActions](/docs/developers/agentactions/) |
| Show the chat full screen in a mobile app WebView (Flutter) | <StatusBadge status="available" /> | [Mobile apps](#mobile-apps) |
| Manage sites, content, and conversations through a server-side REST API, and receive webhooks | <StatusBadge status="coming-soon" /> | [REST API](/docs/developers/rest-api/) |

The JavaScript API doesn't yet include methods to open or close the chat or to listen for widget events. See [What the API doesn't include yet](/docs/developers/javascript-api/#what-the-api-doesnt-include-yet).

## How the pieces fit

- **The loader** (`https://widget.agentmysite.com/loader/widget.js`) is a small script that runs on your page. It draws the launcher, gets a short-lived chat session for the visitor, and opens the chat.
- **The chat** runs in a sandboxed iframe served from `widget.agentmysite.com`. It can't read your page, and your page can't read it.
- **`window.AgentMySite`** is the global object the loader adds to your page. You use it to register the handler that runs your AgentActions.
- **The API** (`api.agentmysite.com`) authenticates the widget, checks that your page's domain is allowed, finds relevant passages in your content, and streams the assistant's answer.

Appearance and behavior (colors, assistant name, auto-open, light or dark mode) and the assistant's welcome message and suggestion chips are set in the admin panel and delivered to the widget when the page loads, so you don't redeploy your site to change them.

## Guides

<CardGrid>
  <LinkCard title="JavaScript API" description="The embed snippet, its attributes, window.AgentMySite, and single-page apps." href="/docs/developers/javascript-api/" />
  <LinkCard title="AgentActions" description="Define tools and run them in your page, with confirmation for actions that change things." href="/docs/developers/agentactions/" />
  <LinkCard title="Security and privacy" description="Tokens, allowed domains, rate limits, CSP hosts, and how data is handled." href="/docs/developers/security/" />
  <LinkCard title="REST API" description="Planned server-side API and webhooks." href="/docs/developers/rest-api/" />
</CardGrid>

## Mobile apps

To show the assistant in a native app, load the widget's mobile page, `https://widget.agentmysite.com/mobile.html`, in a WebView. The mobile page opens the chat full screen right away, without a launcher. Your app passes its settings in a `window.AgentMySiteConfig` object, set before the page script runs:

| Field | Description |
|---|---|
| `siteKey` | Required. Your site key. |
| `apiBase`, `iframeOrigin` | The API and widget hosts (`https://api.agentmysite.com`, `https://widget.agentmysite.com`). |
| `visitorId` | A stable ID your app keeps for the user, so conversations survive app restarts. |
| `conversationId` | The conversation to resume, or `null` to start a new one. |
| `customerId`, `customerName`, `customerEmail`, `shopDomain` | Optional labels, as on the web. |

The page talks to your app through a JavaScript channel named `AgentMySiteHost` (for `webview_flutter`) or a handler with the same name (for `flutter_inappwebview`). It sends JSON events: `ready`, `conversationChanged`, `toolCall`, `requestClose`, `navigate`, and `error`. Your app answers tool calls with `window.agentmysite.toolResult(toolUseId, result, isError)` and can close the chat with `window.agentmysite.close()`. In a WebView, tool calls time out after 20 seconds.

<Aside>
A full mobile guide with a Flutter example is planned. Until then, contact [support@agentmysite.com](mailto:support@agentmysite.com) for help with a mobile integration.
</Aside>

## What visitors might see

These states come from the service, not from your code, but they help when you test your integration:

- **The widget doesn't appear.** The site key is missing or wrong, or the page's domain isn't on the site's allowed list.
- **"This assistant is unavailable right now."** The site has used all its credits for the current billing period. The assistant answers again when credits renew or the plan changes.
- **"You already have a request with our team."** The visitor already has an open support ticket, so the widget doesn't create another one.
- **An error after many messages.** The visitor or the site reached a [rate limit](/docs/developers/security/#rate-limits).
