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.
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_).Add the provider
Wrap your application with
MilanaProvider near the root of the component tree: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.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: Readyin the console - Check that your Product ID starts with
prd_and your Client Key starts withkey_ - 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.useMilana hook
| Property | Type | Description |
|---|---|---|
initialize | () => Promise<{ success: boolean }> | Trigger initialization manually (for deferred init). One-shot; subsequent calls return { success: false }. |
isInitialized | boolean | true after initialization has completed successfully. |
identify | (input: IdentifyInput) => Promise<{ success: boolean }> | Associate the session with a known user. See identify. |
updateUser | (user: UserUpdate) => Promise<{ success: boolean }> | Refresh user identity. See updateUser. |
updateSession | (session: SessionUpdate) => Promise<{ success: boolean }> | Push session metadata. See updateSession. |
trackEvent | (eventName: string, attributes?: TrackEventAttributes) => void | Track a custom event. Calls are queued until initialization completes. |
stopRecording | () => Promise<{ success: boolean }> | End the current session; next initialize() starts a fresh one. See stopRecording. |
update | (payload: UpdatePayload) => Promise<{ success: boolean }> | Deprecated — prefer identify / updateUser / updateSession. See update. |
useMilanaOptional
useMilanaOptional() returns MilanaContextValue | null. Returns null when used outside a MilanaProvider. Useful for shared components that may render in apps that don’t use Milana.
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.