---
schema_version: "1"
id: 4976a4d5f55520ad9f9d495fd8449ec109b19f071525872318fdbe3c66e32b99
title: Identity
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/ios-sdk-v11/sfmc-sdk/classes/identity.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/identity.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 581e87cbddc351a25e6ad8ff68c7af50ea1cbd30d9ec4b63b19fbf8fbb5ec1a1
products:
  - Salesforce Engagement SDK
---
# Identity

`Class`

Main class for managing identity information in the Salesforce Marketing Cloud SDK.

The `Identity` class provides a singleton interface for managing user identity data, including profile information, custom attributes, and party identification details. All operations are performed thread-safely using an internal worker queue.

## Declaration

```swift
@objc(SFIdentity)
public final class Identity : NSObject

@objc
public func toJson() -> String

public func edit(identity updater: @escaping (IdentityModifier) -> IdentityModifier)

public func get() -> IdentityInfo?
```

## Cases

### `toJson()`

Converts the current identity information to a JSON string representation.

```swift
@objc
public func toJson() -> String
```

---

### `edit(identity:)`

Updates the identity information using a modifier closure. This method provides thread-safe access to modify identity data. The updater closure receives an `IdentityModifier` object that allows you to modify profile ID, attributes, and party identification information. All modifications are persisted to the database and trigger identity change events. Thread Safety: This method is thread-safe and uses an internal worker queue to ensure that identity modifications don’t interfere with other operations. Persistence: All changes made through this method are automatically persisted to the database and will trigger identity change events that other SDK modules can observe.

```swift
public func edit(identity updater: @escaping (IdentityModifier) -> IdentityModifier)
```

---

### `get()`

Retrieves the current identity information. This method returns the current identity data including profile ID, attributes, and party identification information. The data is retrieved from the in-memory cache for optimal performance. Thread Safety: This method is thread-safe and uses an internal worker queue to ensure consistent data access. Performance: This method retrieves data from the in-memory cache, making it very fast. If no identity has been set, it returns `nil` .

```swift
public func get() -> IdentityInfo?
```

**Returns:** An `IdentityInfo` object containing the current identity data, or `nil` if no identity record is found or if the identity manager is not properly initialized.

---
