Getting started

Quickstart

A live view counter on your site in about five minutes.

1. Get your site id

Dashboard → Engagement → Sites. A site called "Production" is already there.

Copy the site id (it looks like site_abc123), then add the domains your site runs on to the Allowed origins list — including your local dev URL if you want it working there.

Writes from a domain you haven't listed are rejected. Reads aren't, so if your counter shows a number but a reaction click does nothing, the origin list is the first thing to check.

2. Drop in the snippet

Mark up whatever you want counted:

<article data-vlozi-target="post:post_abc123">
  <h1>How we cut our build time in half</h1>
  <p>…</p>
  <footer>
    <span data-vlozi-views>—</span> views
  </footer>
</article>
 
<script src="https://api.vlozi.app/engagement/e/site_abc123/embed.js" defer></script>

That's it. A view is recorded on load, and the counter fills in.

Where does post:post_abc123 come from? It's post: plus your post's id from the Blog API. Prefer the id over the slug — the id never changes when someone renames a post.

3. Using React?

npm install @vlozi/blog
import { EngagementProvider, EngagementBeacon, ViewCount } from "@vlozi/blog/engage";
 
export function Post({ post }) {
  const target = `post:${post.id}`;
  return (
    <EngagementProvider config={{ siteId: "site_abc123" }}>
      <EngagementBeacon target={target} />
      <article>
        <h1>{post.title}</h1>
        {/* … */}
        <footer><ViewCount target={target} /> views</footer>
      </article>
    </EngagementProvider>
  );
}

4. Add comments

<div data-vlozi-comments></div>
import { Comments } from "@vlozi/blog/engage";
<Comments target={target} />

By default a first-time commenter is held for review and AI screening is on. You'll find them in Dashboard → Engagement → Inbox. Once you've approved someone once, their later comments post straight through.

If you'd rather everything went live immediately, Settings → Comments → Moderation → None. (We'd suggest not doing that on a public blog.)

5. Check it's working

Load your page, then open Dashboard → Engagement → Overview.

The count can take up to a minute to appear — views are batched rather than written one at a time, which is what keeps a post that suddenly gets popular from falling over. If nothing shows after two minutes:

Symptom Usually
No views at all The site id in the snippet doesn't match the dashboard, or the target has no data-vlozi-target
Views work, comments/reactions don't Your domain isn't in Allowed origins
Nothing in a local dev tab Same — add http://localhost:3000
"Waiting for first view" won't clear Your ad blocker. Try a private window.

Next

→ Embedding — reactions, ratings, sign-in, and the full component list → Comments — how moderation actually decides

Engagement · Getting startedEdit on GitHub