Skip to main content
Use this agent skill to set up the widget integration for your website.

anny Widget Integration

Quick Facts

  • Widgets are web components (custom HTML elements).
  • One <script> tag loads all widgets. Load it once per page.
  • Widgets communicate via the iframe they contain — no extra wrapper div or padding is needed. Place the element directly where you want the content.
  • Panels auto-resize to their content. Page widgets and maps support fullscreen or a fixed height.
  • Prefer fullscreen="true" + nav-height for full-page booking so the page itself never scrolls — only the widget scrolls internally. This avoids the awkward double scrollbar (page scroll and widget scroll).
  • Put a-login-button and a-cart-modal-button in the top-right of the main navigation. The cart should show icon + count indicator only (show-icon="true", no label).
  • a-agent-chat embeds the anny AI chat assistant — a launcher in the corner, an in-flow button, or an inline frame. It can drive the whole booking flow conversationally.
  • UTMs and click IDs from the current page URL are forwarded automatically.
  • Start in admin when possible. Admin-generated snippets are the safest source for widget type, slug wiring, and supported options.

Ask First

Before generating integration code, make sure these inputs are known:
  1. Which widget type is needed: page, panel, button, utility, or AI chat?
  2. Which entity is being embedded: resource, service, organization, plan, or package?
  3. What is the exact slug for that entity? (For a-agent-chat, the organization slug and an assistant-id.)
  4. Is booking the main page content, part of an existing layout, or behind a CTA?
  5. Are login and cart needed in the main nav (top-right)?
If the widget depends on an entity slug and the slug is missing, ask the user for it before writing the final snippet. Use these prompts:
  • “What is the exact resource slug?”
  • “What is the exact service slug?”
  • “What is the exact organization slug?”
  • “What is the exact plan slug?”
  • “What is the exact package slug?”
Do not guess slugs.

When details are missing, ask for the admin snippet

If a required value isn’t obvious — an assistant-id for a-agent-chat, an idp-uuid for SSO, or any slug — ask the user to paste the widget code copied from the anny admin area rather than guessing. Admin generates a ready-made snippet with the element, the correct slugs/ids, and supported options already wired. Prompt:
  • “Open this widget in the anny admin area, copy the generated embed code, and paste it here — I’ll adapt it to your site.”
Then keep the admin-provided slugs/ids verbatim and only adjust layout, theming, and placement around them.

Integration Workflow

  1. Ask for the missing slug if the widget is entity-based.
  2. Choose the right widget type: page, panel, button, utility, or AI chat.
  3. Load the widget script once.
  4. Add the required entity slug attribute for that widget.
  5. Place the widget directly into the page layout. For full-page booking, prefer fullscreen="true" + nav-height so only the widget scrolls.
  6. If embedding inside a card, style the wrapper, not the widget.
  7. Add a-login-button and a-cart-modal-button once in the top-right of the main nav when needed (cart = icon + count only).
  8. Add design tokens as HTML attributes if brand customization is needed.
  9. Add event listeners only if external tracking hooks such as GA4 are needed.

Fast Decision Guide

Prefer admin-generated snippets when the user already has the widget configured in anny admin. Use manual HTML when building the integration directly in code or when custom layout control is needed.

Preferred Defaults For New Websites

When building a new website from scratch, prefer these defaults unless the user asks for a different pattern:
  1. Use page content plus a booking panel in the layout.
  2. For a dedicated booking page, use a fullscreen page widget with nav-height set to your header height. This gives a single scroll inside the widget and none on the page — no double scrollbar.
  3. Put a-login-button and a-cart-modal-button in the top-right of the main navigation. Render the cart as icon + count only (show-icon="true", no label).
  4. Use a-subscription-button for plans instead of embedding the plan page inline.
  5. Use a fullscreen calendar page when calendar browsing is a primary use case.
  6. Add a-agent-chat as a bottom-right launcher when the site benefits from assisted/conversational booking or a support helper.
Do not default every new site to a full embedded page widget inside a content layout. Either give booking its own fullscreen page (with nav-height), or embed a panel in the existing layout — pick based on whether booking is the whole page.

Script

Place once in <head> or before </body>. Do not load more than once per page.

Widget Types

Minimal Page Skeleton

For a dedicated booking page where booking is the whole page, swap the panel in <main> for a fullscreen page widget so only the widget scrolls:

Seamless Embedding Patterns

Panel inside a card

Panels resize dynamically. Put them directly inside a card — no extra wrapper or padding needed. Apply overflow: hidden and border-radius to the card, not the widget element.
Do not add padding inside the card around the widget — the widget handles its own internal spacing.

Full-page widget with a single internal scroll (preferred for booking pages)

  • fullscreen="true"height: 100vh
  • nav-height subtracts your sticky header: calc(100vh - 64px). Match it to the real header height so the widget sits flush below the nav and fills the rest of the viewport exactly.
  • The result: the page does not scroll — only the widget scrolls internally. This is the preferred pattern for any full-page booking, calendar, or map experience. It avoids the double-scrollbar problem where both the page and the widget scroll independently.
  • If you give the widget a fixed height attribute, auto-resize is disabled — do not combine height with fullscreen.
Use this especially for booking-first and calendar-first pages where the widget should dominate the layout.

Widget beside editorial content

Panels expand vertically as the user navigates the booking flow. Use align-items: start so they don’t stretch. This is the preferred default for new marketing sites and content-driven pages.

Button widget with a custom trigger

All button widgets accept a slotted element that replaces the built-in button.
When a slot is provided, label, button-background, button-text, and button-width are ignored. Click and keyboard handling are still managed by the widget wrapper.

Login and cart in the top-right of the main nav

Put a-login-button and a-cart-modal-button together in the top-right of the main navigation — the spot users instinctively look for account and cart. Render the cart as an icon with a count indicator only (no text label), like any e-commerce header.
  • These are utility widgets — put them in a stable position users can always find. They sync auth state and cart across all widgets on the page automatically.
  • The cart button shows its own item-count indicator; keep it icon-only (omit label) so it reads as a standard cart icon.
  • drawer is a good modal-layout for the cart so it slides in from the right, matching its top-right anchor.
For new sites, this top-right placement should be the default.

Plan CTA button

For plans and subscriptions, prefer a button that opens checkout instead of embedding the full plan page into a mixed-content page.
Use a-subscription-page only when the whole page is dedicated to the plan checkout experience.

AI Chat Assistant (a-agent-chat)

a-agent-chat embeds the anny AI chat assistant. The visitor can ask questions and the assistant can guide them through the booking flow conversationally; when it needs to show the booking UI it opens it in a modal over the host page. Login (when required) and the user’s access token are handled first-party on the anny chat page — the widget only renders the launcher/panel chrome and forwards configuration. It needs the organization slug and an assistant-id (created in anny admin). Ask for both before generating the snippet.

Placement

Set placement to choose how the chat appears:

Floating launcher (most common)

The launcher is fixed bottom-right and the panel goes fullscreen on mobile. Place it once per page, near </body>.

Inline frame

When the chat is itself a page section, use placement="inline" and give the parent element a fixed width/height — the frame fills it.

Chat attributes

It also accepts the shared design tokens (primary-color, primary-background, text-primary-color, text-secondary-color, button-text, logo-url, locale, …) which are forwarded to the chat surface.

Height Behavior

Required Attributes

Every widget needs:
  • base-url — the anny base URL, e.g. https://anny.co
  • The entity slug for the widget type (resource, organization, service, plan, or package)
Utility widgets are the exception:
  • a-login-button only needs base-url unless SSO options are required
  • a-cart-modal-button only needs base-url

Entity slug mapping

Common functional attributes

Date parameters

Many widgets support start and some also support end.
  • ISO format: 2025-06-15
  • Relative values for start: today, tomorrow, this_week, next_week, this_month, next_month
  • end should be an ISO date string
  • Relative values are not supported by a-resource-calendar or a-organization-calendar

Design Token Pass-Through

Pass brand colors and styling directly as HTML attributes. No CSS override needed.

Color tokens

Text tokens

Background tokens

Border and radius tokens

Shadow tokens

Button styling tokens

These affect the outer CTA button for button widgets, cart button, and login button.

Utility tokens

RGB tokens — auto-calculation

primary-color-rgb, panel-background-rgb, and primary-background-rgb are automatically calculated from their hex counterparts when not explicitly provided. You only need to pass them if you want to supply a custom RGB triplet (e.g. for a non-hex color source). Design rules:
  • Prefer configuring design in admin first. HTML token overrides are for one-off page-specific changes.
  • Keep contrast high between primary actions, text, and backgrounds.
  • small-border-radius is the simplest way to control all corner radii at once. Use panel-border-radius and detail-border-radius only to override specific levels.
  • Do not combine very strong shadows, very round corners, and low-contrast text simultaneously.
Button widgets open content in a modal. Control the layout with modal-layout:

Tracking Events

Booking widgets can emit DOM custom events you can subscribe to on the widget element. Supported event names:
  • view-page
  • add-to-cart
  • start-checkout
  • complete-checkout
Common payload fields:
  • event_name
  • value
  • gross_value
  • tax
  • currency
  • transaction_id
  • items
a-login-button and a-cart-modal-button are utility widgets and are not booking event emitters.

Common Mistakes to Avoid

Attribution Forwarding

UTM params and click IDs (gclid, fbclid, ttclid, li_fat_id) from the page URL are automatically forwarded into the widget iframe. No extra setup needed for conversion tracking.