The Milana SDK records user sessions and provides methods to initialize recording, identify users, update session metadata, track custom events, and stop recording.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.
Installation
- React
- JavaScript
- Script Tag
milana-js/react for React bindings — MilanaProvider, useMilana, useMilanaOptional.See React Setup for the full setup guide.API surface
- React
- JavaScript
- Script Tag
| Property | Type | Description |
|---|---|---|
initialize | () => Promise<{ success: boolean }> | Trigger initialization manually (for deferred init). |
isInitialized | boolean | true after init has completed successfully. |
identify | (input: IdentifyInput) => Promise<{ success: boolean }> | Associate the session with a known user (requires userId + email). |
updateUser | (user: UserUpdate) => Promise<{ success: boolean }> | Refresh user identity (email optional). |
updateSession | (session: SessionUpdate) => Promise<{ success: boolean }> | Update session metadata. |
trackEvent | (eventName: string, attributes?: TrackEventAttributes) => void | Track a custom event. |
stopRecording | () => Promise<{ success: boolean }> | End the current session; next init() starts a fresh one. |
update | (payload: UpdatePayload) => Promise<{ success: boolean }> | Deprecated — prefer identify / updateUser / updateSession. |
Method pages
Initialize
Start recording with your product ID, client key, and session info.
Identify
Associate sessions with known users using
identify().Update User
Refresh user identity mid-session with
updateUser().Update Session
Attach session-level context with
updateSession().Track events
Mark important user actions with named events and attributes.
Stop Recording
End the current session immediately with
stopRecording().Privacy controls
Block, mask, or ignore sensitive elements before they are recorded.
Update (deprecated)
Legacy entry point — kept for backward compatibility.