---
title: "Browser Monitoring for Websites"
description: "Monitor a website with Silly Development: the browser SDK records JavaScript errors, page views and Core Web Vitals with a browser key and no cookies."
url: "https://sillydev.co.uk/docs/monitoring/browser"
updated: "2026-10-14"
---

Monitoring

# Browser SDK

A small script for websites and single-page apps, at \`sillydev/monitoring/browser\`. It sets no cookies and records no IP addresses or user identifiers.

[← Monitoring docs](https://sillydev.co.uk/docs/monitoring) · Updated 14 October 2026

**Browse the docs**

## Set up

Make a browser key (it starts with `sdevb_`) on the project's Settings tab and add your website under Allowed origins. Then call `init()` with the key when the page loads. A browser key is safe to put in your page source; a server key is not.

JavaScript

```
import { init } from 'sillydev/monitoring/browser';

init({
    key: 'sdevb_1_…',
    service: 'website',
    release: '2026.10.1',
    sampleRate: 1,
});
```

## What it records

Uncaught errors and unhandled promise rejections, page views (including navigations in a single-page app), and the Core Web Vitals: largest contentful paint, interaction to next paint, cumulative layout shift, time to first byte and first contentful paint. Each is tagged with the page's path, with ids replaced by `:id` and never the query string.

Turn any of these off with `captureErrors: false`, `pageViews: false` or `webVitals: false`. `sampleRate` is the share of errors and events sent. You can also record your own with `increment`, `timing`, `event`, `captureException` and `captureMessage`, imported from the same module; metric names from a browser must start with `browser.`.

Data is sent in the background with `navigator.sendBeacon`, a few seconds after it is recorded and when the page is hidden, so it does not slow the page down.

Read next

- [Keys Server keys, browser keys and the websites allowed to use them.](https://sillydev.co.uk/docs/monitoring/keys)
- [JavaScript SDK Every function in \`sillydev/monitoring\`, for Node.js and Bun.](https://sillydev.co.uk/docs/monitoring/javascript)
- [Privacy What is collected, what never is, and how to keep it that way.](https://sillydev.co.uk/docs/monitoring/privacy)
