identify()
Associates the current user with all future feedback submissions. Must be called before show() or submitRequest().
maestrio.identify("user-123", {
name: "Jane Doe",
email: "[email protected]",
});Signature
identify(
userId: string,
userProperties?: UserProperties,
systemProperties?: SystemProperties
): voidParameters
userId
| Type | Required | Description |
|---|---|---|
string | Yes | A unique identifier for the user in your system. |
Must be a non-empty string. Throws a ValidationError if empty or not a string.
userProperties
Optional object with information about the user.
| Property | Type | Required | Description |
|---|---|---|---|
name | string | No | Display name |
email | string | No | Email address |
[key] | unknown | No | Any additional custom properties |
systemProperties
Optional object with SDK behavior settings.
| Property | Type | Default | Description |
|---|---|---|---|
autoShow | boolean | false | Automatically show the widget after identifying |
Examples
Basic identification
maestrio.identify("user-123");With user properties
maestrio.identify("user-123", {
name: "Jane Doe",
email: "[email protected]",
avatar: "https://example.com/avatar.jpg",
plan: "pro",
company: "Acme Inc",
});Auto-show the widget
maestrio.identify(
"user-123",
{ name: "Jane Doe", email: "[email protected]" },
{ autoShow: true }
);This is equivalent to calling identify() followed by show().
Behavior
- The identified user is stored in
sessionStorage, so it persists across page navigations within the same tab. - Calling
identify()again replaces the previous identity. - If
autoShowistrue, the widget is shown immediately after identification.