# Add emoji reactions to a plain HTML site

> Add live emoji reactions to any static HTML page with one script tag and one element: no backend, no build step, no cookie banner. Copy-paste snippets, per-post counters, and a check that it works.

Any HTML page can carry live emoji reactions: paste one `<script>` tag in the `<head>` and one `<tapback-bar>` element where the bar should go. Readers tap, everyone on the page sees the reaction fall, and the counts persist — with no server of your own, no build step and no cookie banner. Hand-written pages, a static export from another tool, a single landing page: this guide covers all of them.

## Before you start

You need a Tapbar: the reactions, the look, and a publishable key (`pk_live_…`). [Sign up](https://app.tapback.party), create a Tapbar with your site as an allowed site (add `http://localhost:*` too, to try it on a dev server), and open its **Embed** panel — the loader tag there already carries your key. Your AI agent can do this part for you; see [the last section](https://docs.tapback.party/install/html/#let-your-agent-do-it).

## Add the loader once

The loader goes in the `<head>` of every page (or the shared head include, if the site has one). It defines the `<tapback-bar>` element and starts every bar on the page, however many there are:

```html
<script type="module" async src="https://api.tapback.party/loader.js"
        data-key="pk_live_…" data-api="https://api.tapback.party"></script>
```

Swap `pk_live_…` for your own key, or paste the tag from the Embed panel as it is.

## Put a floating bar on each post

In each post page, add one bar with `layout="float"`, keyed to the same path. It docks in the bottom corner wherever it sits in the markup, and it connects live, so readers see each other's reactions fall.

```html
<!-- on /blog/hello-world/ itself -->
<tapback-bar entity="/blog/hello-world/" layout="float"></tapback-bar>
```

## Add an inline bar to each post in the list

In the post-list page, one bar per post, give every post its own bar, keyed to that post's URL path, such as `/blog/hello-world/`:

```html
<!-- on the post-list page, one per post -->
<article>
  <h2><a href="/blog/hello-world/">Hello, world</a></h2>
  <tapback-bar entity="/blog/hello-world/" layout="inline" live="off"></tapback-bar>
</article>
```

`entity` names the counter. On a list page it has to be set by hand: a bar without it infers the list page's own URL, so every blurb would share one tally. Emit the same value the post page uses and a reaction on the blurb lands on the same count as one on the post.

`live="off"` shows each blurb's count without opening a live socket for it; the falling reactions stay on the post page. Bars that load together share one session request (up to 50 bars each), so a reader can reload a 50-post index about ten times a minute; past a few hundred bars on one page, paginate — see [Troubleshooting](https://docs.tapback.party/troubleshooting/#a-long-list-page-loses-some-bars).

## Different reactions per post (Plus)

By default every post shows your Tapbar's reactions. On [Plus](https://docs.tapback.party/plans/), a post can carry its own: add a named set in the console's Reactions card (say `spooky`, with a ghost and a skull), then point the post's bar at it.

```html
<tapback-bar entity="/blog/the-haunting/" layout="float" set="spooky"></tapback-bar>
```

Write the `set` attribute straight onto that post's bar. To list reactions on the bar instead of naming a set, use `reactions="ghost,skull"`; the keys have to be on the Tapbar or in its palette.

The list-page bars need no `set`. A `live="off"` bar that declares nothing never decides a post's reactions, so the post page's attribute decides them however readers arrive. The attribute applies the first time anyone loads the post; to change a post that's already live, use the ☰ picker in the console's **Pages** tab or the `set_entity_reactions` MCP tool. [Changing reactions on live pages](https://docs.tapback.party/live-pages/) has the full rules.

To choose a post's reactions by looking at the draft instead, add the [in-page picker](https://docs.tapback.party/authoring/) to the draft render: load the editor `<script>` only on the draft or preview render, and put `<tapback-editor>` wherever it suits the editing UI — a sidebar if there is one, otherwise next to the bar.

## Check it works

1. Deploy to a site on the Tapbar's allowed list (or run your dev server, with `http://localhost:*` allowed). The bar only runs on allowed sites.
2. Open a post, tap a reaction, and reload. The count is still there.
3. Open the post list. That post's blurb shows the same count.

If no bar appears, check that the loader tag is in that page's `<head>` and that the page's origin is allowed — `www` and the bare domain are separate entries. [Troubleshooting](https://docs.tapback.party/troubleshooting/) maps each symptom to its fix.

## Notes for plain HTML

- If the site only has standalone pages, one floating bar per page is enough, and `entity` can be left off — the bar infers it from the page URL.
- Every page needs the loader in its `<head>`. If you copy pages by hand, check new ones have it.
- A bar without `entity` infers the page's host plus path (from `<link rel="canonical">` if present), lowercased with no trailing slash — `example.com/blog/hello-world` — so a hand-written `entity="/blog/hello-world/"` on the index won't match it. Write the same value on both.

## Let your agent do it

Connect your agent to the Tapback MCP server — in Claude Code, `claude mcp add --transport http tapback https://api.tapback.party/mcp`; in Claude Desktop or claude.ai, **Add custom connector** with `https://api.tapback.party/mcp` — then paste this prompt:

```
Add Tapback live reactions to my website.

1. Connect to the Tapback MCP server at https://api.tapback.party/mcp and let me approve the sign-in.
2. Ask me for my site's domain, then create a Tapbar with that domain as its allowed site. Give it a heart, a star, and a smile to start — I can change these later.
3. Show me the embed snippet and tell me exactly where it goes in plain HTML: the loader `<script>` in the `<head>` of every page (or the shared head include, if the site has one); an inline bar (`layout="inline"`, `live="off"`) in the post-list page, one bar per post, keyed to that post's URL path, such as `/blog/hello-world/`; and a floating bar (`layout="float"`) in each post page, keyed to the same path. If the site only has standalone pages, one floating bar per page is enough, and `entity` can be left off — the bar infers it from the page URL. The plain HTML guide is at https://docs.tapback.party/install/html/ (as markdown: https://docs.tapback.party/install/html/index.md).
4. Once I've deployed, post a test reaction and read the count back so we know it's working.
```

[Set up with your agent](https://docs.tapback.party/agent-setup/) has the same prompt for every stack, with an optional step for the in-page picker. [Manage from your agent](https://docs.tapback.party/mcp/) lists everything the agent can reach.
