Skip to main content

Browser observability without a long setup

Lens gives you one browser SDK that captures the basics immediately:
  • page views
  • Web Vitals
  • unhandled errors and promise rejections
  • custom interaction and business events when you need them
If you are integrating Lens into a frontend app, start with the web SDK quickstart.

Web SDK Quickstart

Install @lens/web, add your API key, initialize once, and verify data in Lens.

What you need

A Lens project

Create a project in Lens so you have a place for incoming telemetry.

An API key

Generate a project API key from the Lens dashboard before wiring the SDK.

A frontend app

The current public SDK is @lens/web, designed for browser-based apps.

Collector endpoint

Point the SDK at https://collector.lens.sh for production ingestion.
  1. Integrate Lens in one production frontend first.
  2. Verify page views, errors, and Web Vitals arrive as expected.
  3. Add user identity after auth state is available.
  4. Layer in custom interaction and business events only where they add product value.

Next steps

Quickstart

Follow the production setup flow for the web SDK.

Local Docs Development

Preview and edit this Mintlify site locally.