The Gleap identify call lets you tie a user to their feedback items. It includes a unique User ID and optional meta information such as email & name.
Sign in your users
Sign your users in with an identity token: a short JWT your backend signs with an identity key after login. It proves the user ID, the email and any attribute you sign, such as stripeCustomerId. Customer identity explains identity keys and how to sign the token.
The .NET MAUI SDK has no setUserJwt yet. Pass the identity token as the third argument of IdentifyContactAsync, after login and on every app start. The user ID must match the token's userId. The signed fields come from the token. The properties you pass next to it are unsigned.
await Gleap.IdentifyContactAsync(
"12345",
new GleapUserProperty
{
Name = "Franz",
Email = "[email protected]",
},
identityToken); // identity token signed by your backendMoving from an older integration? See Upgrade to identity tokens.
Identify without a token
To effectively manage your contacts, we advise using Gleap.IdentifyContactAsync() each time a user signs in or registers. This practice ensures accurate identification of your contacts from the outset. For scenarios where contact information needs to be updated during active usage – such as when a user subscribes to a new plan or modifies their existing data – we recommend using Gleap.UpdateContactAsync() for seamless real-time updates.
You can also identify a user without a token. The contact is then unsigned: Gleap shows only the last 14 days of conversations, protected fields keep their values, and the call is refused on platforms (web, iOS, Android) where you turned on Require a signature.
Identify your user by calling the following method (GleapUserProperty lives in GleapSDK.Models).
await Gleap.IdentifyContactAsync(
"12345",
new GleapUserProperty
{
Name = "Franz",
Email = "[email protected]",
Phone = "+1 (902) 123123",
CompanyName = "ACME inc.",
CompanyId = "19283",
Plan = "Pro plan",
Avatar = "https://.../avatar.png",
Value = 199.95,
CustomData = new Dictionary<string, object>
{
["key1"] = "Test",
["key2"] = "ACME",
},
});Update contact properties
The UpdateContactAsync method takes the same contact parameters as identify. Partial updates are possible. It can't change protected fields.
await Gleap.UpdateContactAsync(
new GleapUserProperty
{
Plan = "Pro plan",
Value = 199.95,
});Clear the identity on logout
We recommend clearing the identity once the user logs out. Clearing the identity automatically detaches the current session and creates a new guest session.
await Gleap.ClearIdentityAsync();Get the identification status of a user
Gleap.IsUserIdentified();Get the current user identity
Gleap.GetIdentity();
