---
schema_version: "1"
id: a45ec2bfa4dc565cdf9ed1f4cf61fc39bd92e8ed5fa65621f31fbbf2f26dc490
title: getAttributes
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/react/react_getAttributes.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/react_getAttributes.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f0dc698a7b7a85088b66da2b078e4cdb44d9455628a9cd06fde3e495f31d87a0
products:
  - Salesforce Engagement SDK
---
# getAttributes

Returns the maps of attributes set in the registration.

## Syntax

```javascript
MCReactModule.getAttributes() ⇒ Promise.<Object.<string, string>>
```

## Returns

- `Promise.<Object.<string, string>>` - A promise to the key-value map of attributes set in the registration.

## Example

```javascript
import { MCReactModule } from "react-native-marketingcloudsdk";

const getDeviceAttributes = async () => {
  try {
    const attributes = await MCReactModule.getAttributes();
    console.log("Device attributes:", attributes);
    Object.entries(attributes).forEach(([key, value]) => {
      console.log(`${key}: ${value}`);
    });
  } catch (error) {
    console.error("Error getting attributes:", error);
  }
};
```

## See Also

- [setAttribute() Method](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/react_setAttribute.md)
- [clearAttribute() Method](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/react_clearAttribute.md)
- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/MarketingCloudSdk/8.0/-marketing%20-cloud%20-s-d-k/com.salesforce.marketingcloud.registration/-registration-manager/get-attributes.html)
- _SDK Reference for iOS_: [attributes() Method](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/ios-sdk-v11/mce-sdk/classes/marketingcloudsdk.md#attributes)
