Aliases

Add custom Aliases within OneSignal.

This doc covers setting custom aliases and should not be used without first setting External ID. See Users for details before continuing.

A custom alias is a key : value string made up of an alias label (the key) and an alias ID (the value). The alias label can be thought of as a consistent and static keyword across all users, while the alias ID is a specific value to identify a user for that particular label. For example: facebook_id : 3453443, google_id : 573489307569, firebase_id : test3555.

Custom aliases are meant to be used in conjunction with external ID and should not be used on their own without first setting an external ID. See our Users doc for more details.

📘

Benefits of Aliases

  1. Identify users across different databases or platforms. Required for Integrations.
  2. Send transactional messages through our Create Notification REST API.
  3. Fetch, Update and Delete users through our API.

How to Set Aliases

To set custom aliases using the SDK follow these steps:

  1. Set the external ID with the OneSignal.login method
  2. Set the custom aliases with the addAlias or addAliases method
  3. Call OneSignal.logout to remove the external ID and custom aliases for the subscription.

To set a custom alias using our REST API, you can utilize the Create Alias endpoint