Home
/
Desk
/
JavaScript
/
Custom fields

Customer fields

Customer fields enables you to save additional information of a customer, and there are two ways to save information. Additional information can be added by your agents on the Sendbird Dashboard or by your customers from a client app.

Note: Refer to Prerequisite before saving additional customer information.


Store additional information of a customer

Use setCustomerCustomFields() method to let your customers save additional information about themselves directly from their app. The information must consist of a field and its value, and only the field already registered in Settings > Customer fields on the Sendbird Dashboard can be used.

Light Color Skin
Copy
SendBirdDesk.setCustomerCustomFields(
    {
        gender: "male",
        age: 20
    },
    (error) => {
        if (!error) {
        }
    }
    // The additional information of the customer is saved.
    // Some fields can be ignored if their keys aren't registered in the dashboard.
    // Values aren't saved if they don't match the data type of their fields.
);