> For the complete documentation index, see [llms.txt](https://shoppad.gitbook.io/yedric/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shoppad.gitbook.io/yedric/going-further/alerts.md).

# Alerts

Alerts are proactive messages your assistant shows on your site, without waiting for the user to open the chat. Use them to announce a new feature, point people to a guide, run a promotion, or nudge a user toward the assistant when they land on a particular page.

Each alert is configured per assistant and rendered by the widget on your site. You control what it says, where it appears, who sees it, and how often.

## Where to find Alerts

Open your assistant and click **Alerts** in the left sidebar, under the Advanced section. The page lists your existing alerts and a button to create a new one. Selecting an alert opens the editor with a live widget preview so you can see how it will look before saving. Use the Show preview / Hide preview toggle next to **Save** to reveal or collapse the preview.

## Placement types

Every alert has a placement that decides where and how it appears on the page:

* **Message** A small bubble anchored to the chat launcher. This is the only placement that can embed a YouTube video or an image alongside the text.
* **Top** A bar across the top of the page. Optionally set it to **Fixed** so it stays pinned to the top and shifts the page content down to make room, rather than scrolling away with the page.
* **Bottom** A bar fixed to the bottom of the page.
* **Modal** A centered overlay the user must dismiss before continuing.

At most one alert of each placement type shows on a given page. If several alerts of the same type match the current page, the widget rotates through them across page loads so they each get shown in turn.

## Alert settings

When you create or edit an alert, you can set:

**Name** A label for your own reference in the dashboard. It is never shown to users.

**Enabled** Whether the alert is live. Only enabled alerts are sent to the widget. Turn this off to pause an alert without deleting it.

**Headline and Text** The bold first line and the body of the message. For the bar placements a body text on its own is fine, without a headline.

**Button label and Button URL** Add an optional call-to-action button. The button appears only when both a label and a URL are set. The URL supports a few kinds of action:

* A normal web address (`https://...`) opens that link.
* `yedric://chat` opens the chat panel.
* `yedric://chat/your+prompt+here` opens the chat panel and starts a conversation with that prompt.
* `yedric://human` triggers the human-support handoff, the same as the TalkToHuman action.

Start typing `/` in the Button URL field to pick one of the `yedric://` actions from a suggestion menu.

**Page targeting (Match URL)** Restrict the alert to specific pages using the same URL pattern matching as [Page Prompts](/yedric/getting-started/page-prompts.md). Leave it blank to show the alert on every page.

**Username targeting** Limit the alert to specific end users by listing their usernames, separated by commas. Matching is case-insensitive. This works only when the widget identifies users through [Secure Mode](/yedric/developers/secure-mode.md). Leave it blank to show the alert to everyone.

**Show at most** The maximum number of times the alert is shown to the same browser. Set it to 0 for no limit. Once a user dismisses an alert or reaches this cap, it stops appearing for them.

**Delay** How many seconds to wait after the page loads before showing the alert.

**Play sound** Play a short chime when the alert appears.

**Background and text color** Override the default colors for the bar or modal. Leave blank to use the widget's defaults.

**YouTube URL and Image URL** For the Message placement only, embed a YouTube video or show an image inside the bubble.

## Body classes for custom styling

While an alert is visible, the widget adds a class to your page's `<body>` element so your own CSS can react to it if needed: `yedric-alert-message`, `yedric-alert-top`, `yedric-alert-bottom`, or `yedric-alert-modal`.

## When to use Alerts

Reach for Alerts when you want the assistant to speak first. A top bar can announce a release to everyone, a page-targeted message bubble can offer help exactly where users tend to get stuck, and a modal can make sure an important notice is seen. Pair a `yedric://chat/...` button with a starting prompt to drop the user straight into a relevant conversation.
