The User object
And what it contains
As User data is loaded, your designated callback function is called, passing a User object that describes all of the data that has been collected so far.
Your callback will be called multiple times, as the User data is assembled from multiple sources, asynchronously. With each call, the User object contains the data it has loaded so far, and flags to indicate which data has been loaded.
For convenience, the User object contains metadata describing what has already been loaded. This is stored in the
user_data_loadedsub-object, which contains 4 fields;
user_data_loaded.emailis true if the user's email address has been loaded
user_data_loaded.account_infoindicates whether basic account-info has been loaded, including the user's name and email-marketing preferences.
user_data_loaded.custom_fieldsis true if the user's custom fields have been loaded. These are any custom-defined fields you've defined in Webflow memberships.
user_data_loaded.access_groupsis true if the user's access groups have been loaded ( not yet supported ).
To use that in your callback, just check for the kind of data you're needing, before you attempt to use it. This is how to determine if e.g.
user.nameis blank, or just not loaded yet.
user.nameis the User's name
user.emailis the User's email
user.accept_communicationsindicates whether the user wants marketing communications
user.user_id_altis an Alternate user-unique ID that can be used for certain external integrations
Note, that Webflow's own UserID is not yet available using a client-side-only approach. If you need Webflow's UserID in order to make APi calls, you'll need some external processes, which we can help you setup.
Important, when you first create a custom user field in Webflow, it creates a slug that can be used to uniquely identify that field. If you ever change that slug, that change will not affect the internal slug that Webflow represents the field with. This is likely due to the way Webflow has setup its internal CMS datastore.
Not yet supported ( expected Q1 )
Not yet supported, this is something we're working on.
In this feature, you'll be able to store and retrieve arbitrary User-specific data to create a more personalized experience. This is separate from Webflow's custom fields, and can contain things like full JSON objects.