Skip to content

Vite

View Markdown

A plugin plus a one-line init() for any Vite app — React, Vue, Svelte, or Solid.

@everock/vite is a plugin plus a one-line init(). It works for any Vite app — React, Vue, Svelte, or Solid — for browser capture. In an SSR app, instrument the server separately with the Node SDK or the appropriate runtime entry.

Quick start

Install the package

This adapter is available from the source checkout. Build its archive with node scripts/pack-public-packages.mjs dist/npm 0.1.0-beta.1 at the repository root, then install the archive in your app using its actual path.

npm install /path/to/everock/dist/npm/everock-vite-0.1.0-beta.1.tgz

Add the plugin

It emits source maps for symbolication and bakes your public key into the bundle, so init() needs no arguments.

vite.config.ts
import { defineConfig } from 'vite';
import { everock } from '@everock/vite';

export default defineConfig({
  plugins: [everock()],
});

Start capture in your entry

Call init() once, before rendering.

src/main.tsx
import { init } from '@everock/vite/client';
init();

// ...then render your app

Report a handled error

anywhere
import { captureError } from '@everock/vite/client';

try {
  await risky();
} catch (error) {
  captureError(error);
}

Source maps

The plugin's successful client-build hook registers the release and can upload source maps when server-side upload credentials are configured. Set EVEROCK_API_KEY in CI, and keep EVEROCK_RELEASE consistent between the build and captured events. The secret is never baked into the browser bundle.

SSR builds do not run this client-build upload hook. See release tracking and Source maps for manual uploads and matching frame URLs.