---
schema_version: "1"
id: 39ddbbf0104310eb5f101b95bb306e2dea0318c6092da4a6002c759e5443cfc8
title: setContactKey
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/cordova/setContactKey.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/setContactKey.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fedfa398c3586eb9dc7e2bbc50a12481057a06e5ef1d96de4dc03103d1ac7076
products:
  - Salesforce Engagement SDK
---
# setContactKey

Sets the contact key for the device's user.

## Syntax

`MCCordovaPlugin.setContactKey(contactKey, [successCallback], [errorCallback])`

## Kind

Static method of `MCCordovaPlugin`.

## Parameters

| Parameter               | Type       | Description                                                                 |
| ----------------------- | ---------- | --------------------------------------------------------------------------- |
| `contactKey`            | `string`   | The value to be set as the contact key of the device's user.                |
| `successCallback`       | `function` |                                                                             |
| `successCallback.saved` | `boolean`  | Whether the value passed in for `contactKey` was saved in the registration. |
| `errorCallback`         | `function` |                                                                             |
