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" }] }
},
});To pass custom user attributes you must turn on the "Allow custom attributes when identifying users with JS" option from the Frill Script setup identification settings. Using SSO? Check out this guide.
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.
Check out this guide for more information on setting up SSO
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