Profiles are used to accumulate points, virtual goods, and interaction history for users. Profiles are meant to enhance your existing user records if you already have them, but they can also be used independently. For a higher-level view of what profiles do and how they work, read more about them in the profiles section of the product guide.
This guide assumes your project already has user logins, and want to extend them with things like points and leaderboards, or the ability to join chats.
There are two ways to obtain a profile:
- Client-side, using one of the SDK's.
- Server-side, using the REST API.
Once you have a profile instance, you can do things like change its display name and have it join chats. When a profile is created, it includes an Access TokenAccess Token - Token that grants access to the LiveLike REST API. Access tokens can have two levels: Profile and Admin. Profile access tokens (obtained via the SDK/APIs) allow you to store and access data for specific users, but have restricted functionality. Admin access tokens (obtained via the Producer Site) have no restrictions and allow you full access to the LiveLike REST APIs.. This works like a credential, and is what your app needs to save to re-use the profile associated with it. Try to keep it a secret, because anyone who has that access token can use it to modify the profile.
If you know which user to associate the profile with, you should store the access token on your user record. Here are some common scenarios:
- A logged-in user enters a section of the app that has chat or widgets for the first time. Their user account doesn't have a LiveLike access token already stored on it, so a new profile is created with the LiveLike SDK. You then store the access token in the logged-in user's account records.
- A new user signs up in your app. Your backend calls the LiveLike API to create the profile, and stores the profile access token on the new user record.
Now going forward, the LiveLike SDK's should be initialized with that access token. The user associated with that profile will now continue to earn points, gain ranks on the leaderboard, and everything else that the LiveLike SDK allows. Storing the profile access token on the user record allows progress to be saved across installs, devices, and platforms.
Profiles work independently of your login system, so any points that a user earns while logged out can be kept after they sign up or log in! This is common for sophisticated on-boarding where users can try things out before signing up.
A profile can be created before a user login is available, and then kept in session storage. When the user does finally convert, remember to pass along the profile access token so that the signup process can store it on your user record. Then in the future, when that user logs in again, their stored access token can be passed back into the SDK so that the same profile is re-used.
Updated 10 months ago
Read more about Profiles, and how to integrate them on your platform with the LiveLike SDK's.
|User Profile Integration|