Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getmilana.ai/llms.txt

Use this file to discover all available pages before exploring further.

1

Get your Product ID and Client Key

Open your Milana Settings page.Copy your Product ID (starts with prd_) and your Client Key (starts with key_).
2

Install the SDK

npm install milana-js
3

Initialize recording

Import and call init() early in your application startup:
import { init } from "milana-js";

await init("prd_YOUR_PRODUCT_ID", "key_YOUR_CLIENT_KEY", {
  environment: "production",
  version: "1.0.0",
});
Your Client Key is a public identifier meant to be included in client-side code. It does not grant access to your data.
If your site sends a Content-Security-Policy header, add https://in.getmilana.ai to connect-src so the SDK can send recorded data.
4

Identify users

When user information is available, call identify() to attach their identity to the session:
import { identify } from "milana-js";

await identify({
  userId: "usr_12345",
  email: "jane@example.com",
  name: "Jane",
  metadata: {
    createdAt: "2024-03-15T00:00:00Z",
  },
});
5

Track custom events (optional)

import { trackEvent } from "milana-js";

trackEvent("feature_used", { featureName: "export", format: "csv" });
6

Verify in the dashboard

Open the Integration page. Within a few seconds of loading a page with the SDK, a new session should appear under Latest Sessions.If you don’t see sessions after a minute:
  • Open the browser console and look for Milana: log messages
  • Confirm you see Milana: Ready in the console
  • Check that your Product ID starts with prd_ and your Client Key starts with key_
  • See the Troubleshooting guide for more help

Feature-flagged rollout

To roll out Milana gradually or target specific user segments/flows, see the Feature-flagged Rollout guide.

What’s next

Track custom events

Mark important actions so the AI can surface them in query results.

Privacy controls

Block, mask, or ignore sensitive elements in recordings.