For the complete documentation index, see llms.txt. This page is also available as Markdown.

Installation

The simplest way to add MailAgent to your website is with a single <script> tag. Place it before the closing </body> tag:

<script
  src="https://widget.mailagent.email/connect/connect.js"
  data-user-id="YOUR_USER_ID"
></script>

This registers the global window.MailAgent object. You can then open the widget from anywhere in your code.

With Configuration

Pass configuration directly via data-* attributes on the script tag:

<script
  src="https://widget.mailagent.email/connect/connect.js"
  data-user-id="YOUR_USER_ID"
  data-suggestions='[
    {"icon": "✉️", "text": "Write a professional email"},
    {"icon": "📝", "text": "Summarize this thread"}
  ]'
  data-header-transparent="true"
  data-color-background-primary="#2c7df6"
></script>

Single Page Applications (React, Vue, Next.js, etc.)

For SPAs, add the script tag to your root HTML file (index.html, _document.tsx, etc.) or load it dynamically:

React Example

Next.js Example

Add the script in app/layout.tsx or pages/_document.tsx:

Verify Installation

Open your browser's developer console and type:

If it returns "object", the widget is loaded and ready to use.

Last updated