---
schema_version: "1"
id: 45002b19350161b35e500347536641273e2507d401d2b748d430d78451c7ffa9
title: setAttribute
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/cordova/setAttribute.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/setAttribute.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3b64b216671ac4fbfee0b436f8bb7ba545acd69e455532f5fd92d15beb9201c4
products:
  - Salesforce Engagement SDK
---
# setAttribute

Sets the value of an attribute in the registration.

## Syntax

`MCCordovaPlugin.setAttribute(key, value, [successCallback], [errorCallback])`

## Kind

Static method of `MCCordovaPlugin`.

## Parameters

| Parameter               | Type       | Description                                                     |
| ----------------------- | ---------- | --------------------------------------------------------------- |
| `key`                   | `string`   | The name of the attribute to be set in the registration.        |
| `value`                 | `string`   | The value of the `key` attribute to be set in the registration. |
| `successCallback`       | `function` |                                                                 |
| `successCallback.saved` | `boolean`  | Whether the attribute value was set in the registration.        |
| `errorCallback`         | `function` |                                                                 |
