--- title: "User Data" slug: "user-data-react-native-engage" updated: 2026-04-13T15:36:06Z published: 2026-04-13T15:36:06Z canonical: "docs.mapp.com/user-data-react-native-engage" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # User Data ## Introduction The plugin provides methods to identify devices, store custom attributes, manage tags, track events, and handle logout. Most methods are available on both platforms unless noted. ## Device Alias An alias links the device to a known user identity in Mapp Engage. ```javascript // Set alias Mapp.setAlias('user@example.com'); // Set alias and resend previously stored custom attributes to the backend Mapp.setAlias('user@example.com', true); // Get current alias const alias = await Mapp.getAlias(); ``` ## Custom Attributes ### Set ```javascript // Set multiple attributes at once Mapp.setAttributes({ plan: 'premium', region: 'EU' }); // Set a single string attribute Mapp.setAttributeString('plan', 'premium'); // Set a single integer attribute Mapp.setAttributeInt('login_count', 5); ``` ### Get ```javascript const values = await Mapp.getAttributes(['plan', 'region']); const plan = await Mapp.getAttributeStringValue('plan'); ``` ### Remove (Android only) ```javascript Mapp.removeAttribute('plan'); ``` ### Increment Numeric Attribute (iOS only) ```javascript Mapp.incrementNumericKey('purchase_count', 1); ``` ## Tags ```javascript Mapp.addTag('premium'); Mapp.removeTag('trial'); const tags = await Mapp.getTags(); ``` ## Custom Events Use the `CustomEvent` class to build and send tracking events to the Mapp backend. ```javascript import CustomEvent from 'react-native-mapp-plugin/CustomEvent'; import { Mapp } from 'react-native-mapp-plugin'; const event = new CustomEvent('purchase', 49.99); event.transactionId = 'order-12345'; event.addProperty('currency', 'USD'); event.addProperty('category', 'subscription'); await Mapp.addCustomEvent(event); ``` `CustomEvent` constructor and properties: - `name` (string, required): Event name used for identification in Mapp Engage. - `value` (number, optional): Numeric value associated with the event. - `transactionId` (string): Prevents duplicate events on the backend. - `addProperty(name, value)`: Attaches metadata. Value may be string, number, boolean, or string[]. ## Log Out Clears the user identity from the device. Pass `true` to keep push notifications active after logout. ```javascript Mapp.logOut(true); ```