Agent setup: authorize Sight MCP and ask your agent to call get_tracking_setup. It configures this integration automatically.

Lovable

Sight integration guide for apps built with Lovable. Lovable generates real React/Vite code you own — there's no plugin marketplace or settings page to install into, so the install is a prompt you give the Lovable AI, which edits your app's actual source.

Part of Sight, split across repos under the sightapp org — see sightapp/sight-backend's SPEC.md for the full picture. This is a docs-only repo (no code to publish) — same pattern as sight-bolt, sight-vercel-v0, and sight-replit, one per AI app builder.

Install

Paste this into the Lovable chat (replace the API key with your project's):

Add Sight analytics to this app. In index.html, right before the closing </head> tag, add:

<script defer src="https://api.usesight.dev/script.js?k=pk_your_project_api_key"></script>

Sight's script automatically tracks pageviews, including on client-side route changes, so no other code changes are needed.

Tracking custom events

Once the script tag above is loaded, window.analytics.track(name) is available anywhere in the app. Ask Lovable to call it wherever you want a custom event, e.g.:

When the user submits the signup form, call window.analytics.track("signup").

Verify it worked

Open the deployed app, then check GET https://api.usesight.dev/api/v1/query/overview?days=1 (with your X-API-Key header) or the Sight dashboard — a pageview should show up within a few seconds.

Source repository