# Add oloy to this app

oloy records visits to an app and shows its owner how people use it. The prompt that sent you here names this app's oloy address, a URL ending in `/app_…`. It is public, not a secret.

Read the app's code to tell which setup it is, then follow that section alone.

## Lovable

1. Add the npm package `@oloy/sdk`.

2. At the start of the app's browser entry — `src/main.tsx` if it has one, otherwise the root route (e.g. `src/routes/__root.tsx`), in code that runs once in the browser — add:

   ```ts
   import { oloy } from "@oloy/sdk/client";
   oloy("<the oloy address from your prompt>");
   ```

## A Vite or React single-page app

1. Install it: `npm install @oloy/sdk` (or the pnpm, yarn or bun equivalent, if the project uses one).

2. At the start of the app's browser entry — `src/main.tsx`, or the file that mounts the app (`src/main.jsx`, `src/index.tsx`) — add:

   ```ts
   import { oloy } from "@oloy/sdk/client";
   oloy("<the oloy address from your prompt>");
   ```

## Next.js

The browser half only, for now. oloy's server half is added later, from this app's card in oloy.

1. Install it: `npm install @oloy/sdk` (or the pnpm, yarn or bun equivalent, if the project uses one).

2. In the app's `instrumentation-client.ts` — in the project root, or in `src/` if the app lives there; create the file if it isn't there — add:

   ```ts
   import { oloy } from "@oloy/sdk/client";
   oloy("<the oloy address from your prompt>");
   ```

## Any other setup

1. Install it: `npm install @oloy/sdk` (or the pnpm, yarn or bun equivalent, if the project uses one).

2. In the app's main browser entry — the code that runs once when a page of the app loads in the browser — add:

   ```ts
   import { oloy } from "@oloy/sdk/client";
   oloy("<the oloy address from your prompt>");
   ```

## Don't

- Don't add any server code, server SDK or key: oloy goes in the app's browser code alone.
- Don't change the oloy address: keep it in the code exactly as written in your prompt.
- Don't add any other oloy file.
