Chat Widget

The chat widget is a full-page or large overlay chat interface that opens when a visitor clicks the chat button on your site. It provides a rich conversation experience with your agent.

Chat widget
Full chat widget embed

Widget vs. Corner Button

FeatureCorner ButtonChat Widget
SizeSmall bubble in the cornerFull panel (covers part of the page)
InteractionQuick messagesFull conversation with history
CustomizationColor, position, iconColor, size, position, greeting, avatar
Best forQuick help, simple questionsIn-depth conversations, support flows

The corner button is the trigger. The chat widget is the conversation panel that opens when the button is clicked.

Configuration

Appearance

SettingOptionsDefault
Widget width360px - 480px400px
Widget height480px - 720px600px
PositionBottom-right, Bottom-leftBottom-right
ThemeLight, Dark, Auto (matches system)Light
Primary colorAny hex colorYour brand color
Border radius0px - 24px16px

Content

SettingDescription
Welcome messageFirst message shown when the widget opens
Placeholder textInput field placeholder ("Ask me anything...")
Header titleWidget header text (your agent's name)
Header subtitleBelow the title ("Typically replies in seconds")
AvatarAgent avatar shown in the header and with messages

Behavior

SettingOptions
Auto-openOpen the widget automatically after N seconds (or never)
Open on page loadStart with the widget open
SoundPlay a sound when the agent responds
Typing indicatorShow "Agent is typing..." animation
Conversation persistenceRemember conversation across page navigations
Close buttonShow/hide close button in header

Embed code

<!-- Add before </body> -->
<script
  src="https://embed.tinycommand.com/agent.js"
  data-agent-id="YOUR_AGENT_ID"
  data-position="bottom-right"
  data-primary-color="#1c3693"
  data-auto-open="false"
></script>

Available data attributes

AttributeDescription
data-agent-idYour agent's ID (required)
data-positionbottom-right or bottom-left
data-primary-colorHex color for the widget theme
data-auto-opentrue or false
data-auto-open-delaySeconds before auto-opening (e.g., 5)
data-greetingCustom welcome message
data-themelight, dark, or auto
data-hide-launchertrue to hide the corner button (for custom triggers)

JavaScript API

Control the widget programmatically:

// Open the widget
TinyAgent.open();

// Close the widget
TinyAgent.close();

// Toggle open/close
TinyAgent.toggle();

// Send a message programmatically
TinyAgent.sendMessage("I need help with billing");

// Set user context (for personalization)
TinyAgent.setUser({
  name: "Sarah Chen",
  email: "sarah@acme.com",
  plan: "Enterprise"
});

// Listen for events
TinyAgent.on('open', () => console.log('Widget opened'));
TinyAgent.on('close', () => console.log('Widget closed'));
TinyAgent.on('message', (msg) => console.log('Message:', msg));

Custom trigger buttons

Hide the default corner button and trigger the widget from your own UI:

<script src="https://embed.tinycommand.com/agent.js"
  data-agent-id="YOUR_AGENT_ID"
  data-hide-launcher="true">
</script>

<button onclick="TinyAgent.open()">
  Chat with us
</button>

Conversation persistence

When Conversation persistence is enabled:

  • Conversations survive page navigation (the user can browse your site and continue chatting)
  • Conversation history is stored in the browser's localStorage
  • History clears when the user clears browser data or after 30 days of inactivity
  • Each unique browser/device gets its own conversation thread
Tip

Use TinyAgent.setUser() to pass the logged-in user's information to your agent. This lets the agent personalize responses and look up the user's account data without asking them to identify themselves.

Note

The chat widget loads asynchronously and doesn't block your page's initial render. The script size is under 30KB gzipped, with no impact on Core Web Vitals.