> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bily.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify your installation

> Prove Bily loads once and records each page and action without duplicates.

Verify your installation in development or staging before you release it to customers.

## Know what success looks like

| Check            | Expected behavior                                        |
| ---------------- | -------------------------------------------------------- |
| Browser script   | One request and one script element                       |
| Initial document | One automatic `PageView`                                 |
| SPA navigation   | One explicit `PageView` after each later committed route |
| Action event     | One event after the action succeeds                      |
| Console          | No Bily load errors                                      |
| Built assets     | No credentials or private tokens                         |

## Confirm the SDK is ready

Temporarily enable lifecycle diagnostics, then wait for the explicit readiness signal.

```typescript verify-bily.ts theme={null}
import { init, ready, track } from "@bilyai/js";

init({
  scriptUrl: "https://tracking.example.com/b.js?shop=store.example.com",
  debug: true,
});

try {
  await ready();
  track("installation_verified", { test_run: "staging" });
} catch (error) {
  console.error("Bily failed to load", error);
}
```

`debug` logs lifecycle diagnostics, not event payloads. Remove it or set it to `false` when verification is complete.

<Note>
  Normal `track()` calls do not need to await `ready()`. The bounded SDK queue holds calls while the script loads.
</Note>

## Confirm a plain HTML installation

In browser developer tools:

1. Open the **Elements** panel and search for the exact tracking URL.
2. Confirm the document contains one matching script element.
3. Open the **Network** panel and reload the document.
4. Confirm the browser requests the exact URL once, including its query string.
5. Confirm Bily shows one initial `PageView` for that document.

Do not call SDK methods on this path. Plain HTML uses only the raw script.

## Confirm every page appears once

Run these checks:

1. Load a page directly. Expect one automatic `PageView`.
2. Reload it. Expect one new `PageView` for the new document load.
3. In an SPA, navigate to a different route. Expect one explicit `PageView`.
4. Trigger a component rerender without changing the URL. Expect no new page view.
5. Navigate back and forward. Expect one event for each committed URL change.

If the initial load produces two events, remove the manual page-view call from the initial mount. Then check for a second installation.

## Match the complete tracking URL

Do not compare only the hostname. Match the complete URL character for character with the value in Bily. Query parameters and encoded characters are part of the installation contract.

## Clear the production gates

* Disable temporary diagnostics.
* Confirm your consent controls run before optional customer data is sent.
* Search built browser assets for credentials and private tokens.
* Confirm failed operations do not emit success events.
* Verify the same action does not fire from both a container and a nested component.

<Card title="Troubleshoot a failed check" icon="screwdriver-wrench" href="/troubleshooting">
  Diagnose timeouts, duplicate page views, missing routes, and incorrect tracking URLs.
</Card>
