Step 5: SDK Setup
With your API Key in hand, you are ready to integrate the Nveal SDK into your website.
Installation
Choose the method that best fits your project:
The easiest way to get started. Add the Nveal script tag directly to your HTML <head>. This works with any backend — PHP, Spring Boot, Django, Rails, or plain HTML.
For JavaScript/TypeScript projects using a bundler like Vite, Webpack, or Next.js.
1. Install the package:
2. Initialize in your app's entry point (e.g., main.ts, _app.tsx, or main.js):
Tip
For Next.js, initialize inside a Client Component ('use client') or inside a useEffect hook to ensure it only runs in the browser.
What happens next?
As soon as Nveal.init() runs, the SDK:
- Validates the API Key and Origin Domain.
- Takes an initial snapshot of the DOM.
- Begins quietly recording subsequent mutations, mouse movements, and clicks in the background.