Extend user data in Sharetribe Web Template
This guide shows you how to expand the user data model in your marketplace with code. We’ll have a look on how the user can be configured so that the data gets added, and how it can then be presented.
Adding new attributes to the data model relies on extended data. In Sharetribe Web Template, starting from release v5.0.0 , top-level user extended data can be configured in the configUser.js file.
As of November 2025, public and private user fields can be configured in Console. Protected data user fields still need to be configured in configUser.js.
In addition, Console allows configuring up to 100 user fields. If you have more than 100 user fields configured in Console, for example if you have a complex user type and user field setup on your marketplace, you will need to configure the rest of your user fields in configUser.js.
- configUser.js
Settings configured in local configurations files are overridden by any fetched via the Asset Delivery API. You can refer to this article to modify the way your template merges local and hosted configurations.
Configuring the user data this way allows you to
- declare the attribute and its possible values
- show the attribute selection inputs in the signup page, and
- optionally show public attribute values on the user’s profile page
Add a new top-level protected data attribute
Let’s extend the default user data by adding a protected data attribute ‘arrivalInstructions’ to allow providers to share how customers can get to their service facility. Adding the attribute as protected data allows us to expose the attribute to the other party of the transaction – see these instructions for more details.
The full configuration looks like this:
{
key: 'arrivalInstructions',
scope: 'protected',
schemaType: 'text',
showConfig: {
label: 'How do people arrive at your facility?',
},
saveConfig: {
label: 'How do people arrive at your facility?',
displayInSignUp: true,
isRequired: true,
},
// If you have defined user types, you can limit
// individual user fields to specific user types:
userTypeConfig: {
limitToUserTypeIds: true,
userTypeIds: ['provider'],
},
},Declare the attribute and its possible values
Extended data attributes in the configUser.js file need to be defined,
at minimum, by key, by scope, and by schemaType.
key: 'arrivalInstructions',
scope: 'protected',
schemaType: 'text',This attribute is defined as protected, so it will be saved into the
user’s profile as protectedData.arrivalInstructions. The
schemaType attribute determines the shape of the data being saved:
- enum attributes are saved as a single string value from a list of predefined options
- multi-enum attributes are saved as an array of string values from a list of predefined options
- boolean attributes are saved as true or false boolean values
- long attributes are saved as long i.e. as an 8-byte whole number
- text attributes are saved as a single text entry
If the schema type is enum or multi-enum, you will need to
define an array of enumOptions for the attribute. This allows the user
profile page and signup page to show the options when your user creates
or edits their profile.
Configure the signup page
The ProfileSettingsPage and AuthenticationPage are configured to
show specific inputs for specific schema types. This means that you only
need to configure how the attribute shows up in the panel.
By default, public user fields are collected on the profile settings page and shown on the public user profile page.
All configured user fields are collected on the authentication page. If
you want to hide a field from the signup page, you will need to set
displayInSignup as false.
Starting in template version
10.3.0 ,
private and protected data fields are modified in ManageAccountPage.
In earlier versions, all user fields were shown and modified on
ProfileSettingsPage. If you have added user fields with non-public
scopes (private and protected) in an earlier version, double check
whether you want to keep editing those fields on the
ProfileSettingsPage or move the logic onto the ManageAccountPage.
You can separately determine the label for editing the attribute and displaying the attribute, if it is displayed publicly. You can also set the attribute as required.
saveConfig: {
label: 'How do people arrive at your facility?',
displayInSignUp: true,
isRequired: true,
},Configure the profile page for public fields
Protected and private user fields are managed on the ManageAccountPage, and they are not displayed on other pages. For these scopes, in other words, there is no display configuration.
For public user fields, the configuration for showing top-level extended
data on the profile page is straightforward. By default, all public user
config attributes with a showConfig.label are shown on the user’s
public profile page, but by setting displayInProfile to false on an
attribute with schema type enum, long, or boolean, you can hide
the attribute from the Details section on the profile page.
// showConfig: {
// label: 'Do you offer other services besides bike rentals?',
// displayInProfile: true,
},And that is it! With this configuration, a custom user attribute can be added to the user’s extended data on authentication page, and public fields can be shown on the user’s profile page.