Enum to represent valid genders.
Enum to represent notification status for email and push notifications.
Adds an an alias for the user. (alias, label) pairs can exist on one and only one user. If a different user already has this alias or external user id, the alias attempt will be rejected on the server.
An identifier for this user.
A label for the alias. e.g. the source of the alias, like "internal_id"
Whether the update was successfully enqueued.
Adds a string to a custom attribute string array, or creates that array if one doesn't exist.
The identifier of the custom attribute. Limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
The string to be added to the array. Strings are limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
Whether the update was successfully enqueued.
Adds a user to an email or SMS subscription group.
The unique identifier of the subscription group.
Whether the update was successfully enqueued.
Asynchronously retrieves the current user's id, or null if the user is anonymous / has not been identified. For example:
braze.getUser().getUserId(function(userId) {
console.log('The user is ' + userId);
});
Asynchronous callback - this will be invoked with the userId.
Increment/decrement the value of a custom attribute. Only numeric custom attributes can be incremented. Attempts to increment a custom attribute that is not numeric will be ignored. If you increment a custom attribute that has not previously been set, a custom attribute will be created and assigned the value of incrementValue. To decrement the value of a custom attribute, use a negative incrementValue.
The identifier of the custom attribute. Limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
Default 1. May be negative to decrement.
Whether the update was successfully enqueued.
Removes a string from a custom attribute string array.
The identifier of the custom attribute. Limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
The string to be removed from the array. Strings are limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
Whether the update was successfully enqueued.
Removes a user from an email or SMS subscription group.
The unique identifier of the subscription group.
Whether the update was successfully enqueued.
Sets the country for the user.
Limited to 255 characters in length. Accepts an explicit null value to null out attribute.
Whether the update was successfully enqueued.
Sets a custom user location attribute.
The identifier of the custom location attribute. Limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
The latitude of the user's location in (valid values are between -90 to 90 degrees). Passing a null value for both latitude and longitude will remove this custom attribute from the user.
The longitude of the user's location (valid values are between -180 to 180 degrees). Passing a null value for both latitude and longitude will remove this custom attribute from the user.
Whether the update was successfully enqueued.
Sets a custom user attribute. This can be any key/value pair and is used to collect extra information about the user.
The identifier of the custom attribute. Limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
Can be numeric, boolean, a Date object, a string, or an array of strings. Strings are limited to 255 characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation. Passing a null value will remove this custom attribute from the user.
Whether the update was successfully enqueued.
Sets the date of birth of the user. Alternatively takes in null values for all parameters to set date of birth to null.
1-12
Whether the update was successfully enqueued.
Sets the email address of the user.
Must pass RFC-5322 email address validation. Accepts an explicit null value to null out attribute.
Whether the update was successfully enqueued.
Sets whether the user should be sent email campaigns.
Notification setting (explicitly opted-in, subscribed, or unsubscribed).
See the NotificationSubscriptionTypes
enum.
Whether the update was successfully enqueued.
Sets the first name of the user.
Limited to 255 characters in length. Accepts an explicit null value to null out attribute.
Whether the update was successfully enqueued.
Sets the home city for the user.
Limited to 255 characters in length. Accepts an explicit null value to null out attribute.
Whether the update was successfully enqueued.
Sets the language for this user. By default, the user's language is detected automatically from the browser. If you call this method, Braze will ignore the detected language and use the language you have provided instead.
An ISO 639-1 Language Code. Accepts an explicit null value to null out attribute.
Whether the update was successfully enqueued.
Sets the last known location for the user.
The latitude of the user's location in (valid values are between -90 to 90 degrees)
The longitude of the user's location (valid values are between -180 to 180 degrees)
The accuracy of the user's lat/long in meters.
The altitude of the user's location in meters above or below the WGS 84 reference ellipsoid.
The accuracy of the user's altitude in meters.
Whether the update was successfully enqueued.
Sets the last name of the user.
Limited to 255 characters in length. Accepts an explicit null value to null out attribute.
Whether the update was successfully enqueued.
Sets the phone number of the user.
A phone number is considered valid if it is no more than 255 characters in length and contains only numbers, whitespace, and the following special characters +.-() Accepts an explicit null value to null out attribute.
Whether the update was successfully enqueued.
Sets whether the user should be sent push campaigns.
Notification setting (explicitly opted-in, subscribed, or unsubscribed).
See the NotificationSubscriptionTypes
enum.
Whether the update was successfully enqueued.
Do not construct directly - use
getUser
to get the user object. User provides an object which lets you update the attributes stored by Braze for your user.This class has been designed to provide fire and forget semantics and to not impact the performance or lifecycle of calling code. As such, changes made to an User are enqueued locally and flushed to Braze's servers asynchronously.