thelastapi
Get started free

Session replay for a small site: masked, cheap and useful

Session replay for a small site records user bugs and friction with client-side masking, low storage costs, and a single script tag.

On this page 7 sections

Session replay for a small site captures broken interactions and customer confusion without exposing private user data or running up a large monthly software bill. With thelastapi, analytics events and replay recording sessions cost $0, billing only $0.023 per GB-month for storage (plus the standard 20% platform margin). You drop a single script tag into your HTML, sessions record automatically with client-side masking on all sensitive fields, and you can inspect rage clicks or errors directly from your terminal or dashboard.

This guide covers how replay works on small websites, how to protect visitor privacy, and how to spot broken pages without spending your week watching video recordings.

Why traditional replay is painful for small sites

When you run a new product or a small business site, understanding where users get stuck is critical. But most dedicated recording tools create three problems:

  1. Inflated pricing tiers. Traditional services charge per recorded session or force you into expensive plans designed for large enterprises. If a blog post goes viral or a bot visits your site, your bill spikes.
  2. Privacy and compliance leaks. Many recorders stream raw DOM snapshots to their servers by default. If your visitor types an email, phone number, or address into a form, that text might sit unmasked in a third-party database unless you configure rules.
  3. Time sinks. Watching fifty 10-minute videos of visitors casually reading your landing page does not help you ship faster. You need to jump straight to the moments where something broke: a JavaScript crash, an abandoned checkout form, or a user furiously clicking a broken button.

thelastapi addresses this with an integrated replay resource that pairs with built-in analytics. Replay sessions cost $0 to record, store data in compressed chunks up to 1 MB for 30 days by default, and mask sensitive personal data inside the visitor's browser before the network request ever sends.

How to add replay to your site

You can enable replay on sites hosted on thelastapi or on sites running on another host. If you are starting fresh, initialize a project with replay enabled:

Terminal
vibiz init "My Store" --resources analytics,replay

If you already have a running project, add the resource using the CLI:

Terminal
vibiz add replay

The replay resource automatically brings the privacy-first analytics resource with it. On thelastapi hosting, your production environment automatically receives NEXT_PUBLIC_VIBIZ_ANALYTICS_KEY and NEXT_PUBLIC_VIBIZ_ANALYTICS_URL. You install the snippet in your site's <head> tag:

HTML
<script defer src="https://thelastapi.dev/v1/script.js" data-key="vz_pk_12345"></script>

Running on another host

If your site is hosted elsewhere, you can still use the same replay tag. Register your project and point your custom domain as an external site:

Terminal
vibiz init mysite --resources analytics,replay
vibiz domains add example.com --elsewhere
vibiz analytics snippet

Copy the snippet output and paste it before </head> on every page. For more details on external deployments, read our guide on how to add analytics to any site with one tag.

Events and session chunks are only accepted from domains linked to the project (including its default .vibiz.app address and custom domains). Unauthorized domains return a 403 forbidden error.

Privacy-first masking in the browser

Session replay must respect visitor privacy. If private data leaves the browser, you risk exposing credentials and violating local privacy regulations.

thelastapi masks data in the browser before upload:

  • Authentication data: Password fields, credit card inputs, and one-time code fields are never recorded under any circumstances.
  • Payment data: Card numbers and IBANs typed anywhere on the page are automatically detected and masked.
  • Contact details: Any page text matching email or phone number formats is converted to masked characters before leaving the DOM.
  • URLs: Query strings are stripped from page URLs automatically so secret tokens or personal parameters never hit storage.

Form fields are shown as typed unless they contain sensitive patterns. You can also explicitly control how specific elements render:

HTML
<!-- Mask an entire section of text or markup -->
<div data-vibiz-mask>
  <p>Account balance: $4,500.00</p>
</div>

<!-- Completely block an input field from recording -->
<input type="text" name="tax_id" data-vibiz-sensitive />

Masked text appears as bullets or asterisks, and blocked regions show up as striped boxes.

If you operate in jurisdictions requiring explicit consent before recording, set require_consent: true in your replay configuration. When enabled, the script will not record until your consent banner fires the start command:

JavaScript
vibiz('replay', 'start');

Visitors who decline can be ignored, or you can halt recording at any point using vibiz('replay', 'stop'). Learn more about configuring compliant banners in our guide to session replay with consent first.

Tuning replay settings and costs

Replay recording is priced strictly by raw storage:

ItemRateDetails
Session Recording$0Unlimited session recording
Custom Events$0Scalar JSON properties up to 8 KB
Replay Storage$0.023 / GB-monthBilled with standard margin (+20% today)
Retention Window30 days defaultConfigurable between 1 and 90 days

To manage volume on high-traffic sites, you can tune the resource configuration via PATCH /v1/projects/:id/resources/replay:

Terminal
curl -X PATCH "https://thelastapi.dev/v1/projects/prj_123/resources/replay" \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "sample_rate": 0.5,
      "require_consent": false,
      "retention_days": 14,
      "record_css_rules": true
    }
  }'

When sample_rate is set below 1.0, non-sampled visits do not discard recording entirely. Instead, the browser holds the buffer and uploads the session only if a friction signal occurs: an unhandled JavaScript error, a dead click, or a rage click.

Spotting bugs without watching hours of video

You do not need to sit through endless real-time video feeds to find broken parts of your application. You can query problem sessions directly from the CLI:

Terminal
# List sessions with unhandled errors over the last 7 days
vibiz replays --errors --period 7d

# List sessions with rage clicks or dead clicks
vibiz replays --rage --dead --period 7d

To inspect an individual recording, run:

Terminal
vibiz replay rpl_123

This returns the session signals and a secure link to watch the replay in your browser.

Inspecting sessions with replay frames

When you want an immediate visual check without loading an entire playback canvas, fetch replay frames. The API reconstructs the recorded DOM as a static document and captures full viewport screenshots at key friction points:

Terminal
# Download still screenshots of error moments and rage clicks
vibiz replays frames rpl_123 --moments error,rage_click --out ./frames

Each image outlines the clicked element and marks the cursor position with a dot. Because frames are rendered using the visitor's actual viewport dimensions, a mobile user's layout glitch appears exactly as a phone-sized screenshot. See our tutorial on how to see what a visitor saw: replay frames as screenshots for visual debugging examples.

Automated checks in Mission Control

You do not even have to remember to check the CLI. Every active project has automated health monitoring through Mission Control and health checks.

About once an hour, our background checks evaluate your project's user experience step:

  • Warning: Triggered if 3 or more sessions have JavaScript errors, 5 or more have rage clicks, or 10 or more have dead clicks within 24 hours.
  • Failure: Triggered if errors spike to 10 or more sessions in 24 hours (at least 3 times your typical daily baseline).
Terminal
vibiz health

When an experience check turns amber or red, Mission Control links you directly to the latest problematic replay so you can resolve the issue before customers churn. Read our overview on how to know when your site goes down, a deploy fails or sales stop to explore automated monitoring.

Next steps

Add the replay resource to your project with vibiz add replay, verify your domain, and review your site layout with vibiz replays --errors. Full endpoint parameters and SDK methods are documented in the Analytics and replay reference.

Frequently asked questions

Does the session replay script slow down my site's page load?

No. The script is deferred, non-blocking, and uploads replay snapshots in compressed chunks of up to 1 MB asynchronously in the background.

How long are session recordings kept before deletion?

Recordings are kept for 30 days by default, but you can adjust the retention window between 1 and 90 days using the `retention_days` setting on the replay resource.

Can my AI agent inspect session replays directly?

Yes. AI agents can query findings using the tools `vibiz_replay_insights`, `vibiz_replay_detail`, `vibiz_replay_frames`, and `vibiz_replay_share_link`. All captured page text is masked and marked untrusted so it cannot execute prompt injections.

What happens if a visitor uses an ad blocker or disables browser storage?

If storage is disabled, setting `data-no-storage` on the script tag tells the analytics engine to identify visits using a daily-salted hash with no cookies and no stored IP addresses.