Identifying users
Guest users can be identified when you first load the Frill Script, or at any time using the identify command.
Important
You must provide a valid email.
Name is optional but recommended
Guest authentication will fail if:
Your Widget/Survey has user/password or SSO authentication enabled
The email is associated to an existing user/password account
The simplest way to identify users is with the container command. Just define the user as part of your configuration.
window.Frill('container', {
key: 'YOUR_SCRIPT_KEY',
user: {
email: '[email protected]',
name: 'my user', // optional
// You can also pass custom variables (attributes and companies) when identifying users
// attributes: { mrr: 100 },
// companies : [{ id: 'frill', name: "Frill.co" }] }
},
});Frill('identify')
Frill('identify') If your app has client side authentication, you can identify the user using the identify command when they login. The identify command will identify the user for all active (and future) Widgets & Surveys.
If the user logs out, you should unidentify them:
Single Sign On (SSO)
You can identify SSO users by passing a signed SSO JWT instead of user details.
Check out this guide for more information on setting up SSO
Custom attributes
Custom attributes are a powerful way to segment your users inside of Frill. You can pass custom attributes when you identify users, just include an attributes and/or companies object alongside the user details.
iFrames
If you're loading your Widget in an iFrame you can still identify users (including SSO) by passing the user details as a query parameter.
Guest users
You can authenticate guest users by passing their details as the user query parameter. The object should be encoded and must have a valid email.
SSO users
To identify SSO users in an iFrame, pass your signed SSO JWT as the ssoToken query parameter.
Last updated