SFMC Core

This section provides API reference details for SFMC Core module in React Native unified plugin.

Sets the profile identifier for the device user.

ParameterTypeDescription
profileIdstringThe profile ID (contact key) for the device user. Use a stable identifier, such as a CRM user ID or email-based key, so the same user is recognized across sessions.
  • void

Returns the profile identifier currently set on the device.

  • Promise<string \| null> - A promise that resolves to the current profile ID.

Sets an attribute value in the device user’s registration profile.

ParameterTypeDescription
keystringThe attribute name in the registration profile.
valuestringThe attribute value to assign to key in the registration profile.
  • void

Sets multiple attribute values in the device user’s registration profile in one call.

ParameterTypeDescription
attributesobjectThe key-value map of identity attributes to set in one call. Each key is an attribute name and each value is a string attribute value.
  • void

Clears an attribute value from the device user’s registration profile.

ParameterTypeDescription
keystringThe attribute name whose value is cleared from the registration profile.
  • void

Clears all attributes from the device user’s registration profile.

  • void

Returns the attributes currently set in the device user’s registration profile.

  • Promise<object \| null> - A promise that resolves to the attribute key-value map.

Sets the party identification name in the device user’s identity profile.

ParameterTypeDescription
namestringThe party identification name for the device user.
  • void

Sets the party identification number in the device user’s identity profile.

ParameterTypeDescription
numberValuestringThe party identification number for the device user.
  • void

Sets the party identification type in the device user’s identity profile.

ParameterTypeDescription
typestringThe party identification type for the device user.
  • void

Returns the party identification name currently set on the device.

  • Promise<string \| null> - A promise that resolves to the current party identification name.

Returns the party identification number currently set on the device.

  • Promise<string \| null> - A promise that resolves to the current party identification number.

Returns the party identification type currently set on the device.

  • Promise<string \| null> - A promise that resolves to the current party identification type.

Tracks an event, which can trigger SDK actions such as in-app message display.

ParameterTypeDescription
eventobjectThe SFMCEvent payload to track. Valid event types are CustomEvent, EngagementEvent, IdentityEvent, SystemEvent, CartEvent, OrderEvent, and CatalogObjectEvent.
  • void

Tracks an event and sends it immediately without waiting for the next batch cycle.

ParameterTypeDescription
eventobjectThe SFMCEvent payload to track and send immediately. Valid event types are CustomEvent, EngagementEvent, IdentityEvent, SystemEvent, CartEvent, OrderEvent, and CatalogObjectEvent.
  • void

Flushes all queued events to Marketing Cloud servers immediately.

  • void

Sets the log level for the native Marketing Cloud SDK and Unified SFMC SDK.

ParameterTypeDescription
levelstringThe SDK log level. Valid values are DEBUG, WARN, ERROR, and NONE.
  • void

Returns the current SDK state object for diagnostics and support troubleshooting.

  • Promise<object> - A promise that resolves to the SDK state object.