---
schema_version: "1"
id: 586fa54ec630e07c8ab0c74de2c836697028c0eb54a21bb0908ac3ae67431701
title: SFMC Core
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/flutter-hybrid/flutter-sfmc-core.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter-sfmc-core.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d92451f5b3a41e550a6f0c421f38a7ae0be14a896caa53ee768b9fd8b20cabc8
products:
  - Salesforce Engagement SDK
---
# SFMC Core

This section provides API reference details for the SFMC Core module in the Flutter unified plugin.

## setProfileId

Sets the profile identifier for the device's user.

### Syntax

```dart
SFMCSdkModule.setProfileId(profileId);
```

### Parameters

| Parameter   | Type     | Description                                              |
| ----------- | -------- | -------------------------------------------------------- |
| `profileId` | `String` | The value to set as the profile ID of the device's user. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.setProfileId('user-1234');
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity-editor/profile-id.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(py)profileId>)

## getProfileId

Returns the profile identifier for the device.

### Syntax

```dart
SFMCSdkModule.getProfileId();
```

### Returns

- `Future<String?>` - A future that completes with the current profile ID.

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
final profileId = await SFMCSdkModule.getProfileId();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity/profile-id.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityInfo.html#/c:@M@SFMCSDK@objc(pl)SFIdentityInfo(py)profileId>)

## setAttribute

Sets the value of an attribute in the identity.

### Syntax

```dart
SFMCSdkModule.setAttribute(key, value);
```

### Parameters

| Parameter | Type     | Description                        |
| --------- | -------- | ---------------------------------- |
| `key`     | `String` | The name of the attribute to set.  |
| `value`   | `String` | The value of the attribute to set. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.setAttribute('email', 'sample@example.com');
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-attributes-editor/put.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(im)addAttributeWithKey:value:>)

## clearAttribute

Clears the value of an attribute in the identity.

### Syntax

```dart
SFMCSdkModule.clearAttribute(key);
```

### Parameters

| Parameter | Type     | Description                                      |
| --------- | -------- | ------------------------------------------------ |
| `key`     | `String` | The name of the attribute to clear the value of. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.clearAttribute('email');
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-attributes-editor/clear.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(im)clearAttributeWithKey:>)

## setAttributes

Sets multiple attributes in the identity in one call.

### Syntax

```dart
SFMCSdkModule.setAttributes(attributes);
```

### Parameters

| Parameter    | Type                  | Description                      |
| ------------ | --------------------- | -------------------------------- |
| `attributes` | `Map<String, String>` | A map of key-value pairs to set. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.setAttributes({
  'email': 'sample@example.com',
  'tier': 'gold',
});
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-attributes-editor/set.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(im)addAttributesWithAttributes:>)

## getAttributes

Returns a map of attributes for the identity.

### Syntax

```dart
SFMCSdkModule.getAttributes();
```

### Returns

- `Future<Map<String, String>?>` - A future that completes with the current attribute map.

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
final attributes = await SFMCSdkModule.getAttributes();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity/attributes.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityInfo.html#/c:@M@SFMCSDK@objc(pl)SFIdentityInfo(py)attributes>)

## clearAllAttributes

Clears all attributes from the identity.

### Syntax

```dart
SFMCSdkModule.clearAllAttributes();
```

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.clearAllAttributes();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity/-builder/clear-attributes.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(im)clearAllAttributes>)

## getPartyIdentificationName

Returns the party identification name currently for the device.

### Syntax

```dart
SFMCSdkModule.getPartyIdentificationName();
```

### Returns

- `Future<String?>` - A future that completes with the current party identification name.

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
final partyName = await SFMCSdkModule.getPartyIdentificationName();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity/party-identification-name.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityInfo.html#/c:@M@SFMCSDK@objc(pl)SFIdentityInfo(py)partyIdentificationName>)

## setPartyIdentificationName

Sets the party identification name for the device's user.

### Syntax

```dart
SFMCSdkModule.setPartyIdentificationName(name);
```

### Parameters

| Parameter | Type     | Description                                |
| --------- | -------- | ------------------------------------------ |
| `name`    | `String` | The display name or full name of the user. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.setPartyIdentificationName('Jane Doe');
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity-editor/party-identification-name.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(py)partyIdentificationName>)

## getPartyIdentificationNumber

Returns the party identification number of the device.

### Syntax

```dart
SFMCSdkModule.getPartyIdentificationNumber();
```

### Returns

- `Future<String?>` - A future that completes with the current party identification number.

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
final partyNumber = await SFMCSdkModule.getPartyIdentificationNumber();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity/party-identification-number.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityInfo.html#/c:@M@SFMCSDK@objc(pl)SFIdentityInfo(py)partyIdentificationNumber>)

## setPartyIdentificationNumber

Sets the party identification number for the device's user.

### Syntax

```dart
SFMCSdkModule.setPartyIdentificationNumber(number);
```

### Parameters

| Parameter | Type     | Description                              |
| --------- | -------- | ---------------------------------------- |
| `number`  | `String` | A unique identifier number for the user. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.setPartyIdentificationNumber('PID-1001');
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity-editor/party-identification-number.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(py)partyIdentificationNumber>)

## getPartyIdentificationType

Returns the party identification type currently set on the device.

### Syntax

```dart
SFMCSdkModule.getPartyIdentificationType();
```

### Returns

- `Future<String?>` - A future that completes with the current party identification type.

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
final partyType = await SFMCSdkModule.getPartyIdentificationType();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity/party-identification-type.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityInfo.html#/c:@M@SFMCSDK@objc(pl)SFIdentityInfo(py)partyIdentificationType>)

## setPartyIdentificationType

Sets the party identification type for the device's user.

### Syntax

```dart
SFMCSdkModule.setPartyIdentificationType(type);
```

### Parameters

| Parameter | Type     | Description                                  |
| --------- | -------- | -------------------------------------------- |
| `type`    | `String` | The category or classification for the user. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.setPartyIdentificationType('customer');
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.identity/-identity-editor/party-identification-type.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Protocols/IdentityModifier.html#/c:@M@SFMCSDK@objc(pl)SFIdentityModifier(py)partyIdentificationType>)

## track

Tracks an event, which could result in actions such as an in-app message being displayed.

### Syntax

```dart
SFMCSdkModule.track(event);
```

### Parameters

| Parameter | Type        | Description                                                             |
| --------- | ----------- | ----------------------------------------------------------------------- |
| `event`   | `SFMCEvent` | An `SFMCEvent` instance to track, such as `CustomEvent` or `CartEvent`. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.track(CustomEvent(name: 'purchase', attributes: {'item': 'shoes'}));
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk/-s-f-m-c-sdk/-companion/track.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Classes/SFMCSdk.html#/c:@CM@SFMCSDK@objc(cs)SFMCSdk(cm)trackWithEvent:>)

## sendImmediate

Tracks an event and sends it immediately without waiting for the next batch cycle.

### Syntax

```dart
SFMCSdkModule.sendImmediate(event);
```

### Parameters

| Parameter | Type        | Description                                                                        |
| --------- | ----------- | ---------------------------------------------------------------------------------- |
| `event`   | `SFMCEvent` | An `SFMCEvent` instance to send immediately, such as `CustomEvent` or `CartEvent`. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.sendImmediate(CustomEvent(name: 'purchase', attributes: {'item': 'shoes'}));
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk/-s-f-m-c-sdk/-companion/send-immediate.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Classes/SFMCSdk.html#/c:@CM@SFMCSDK@objc(cs)SFMCSdk(cm)sendImmediateWithEvent:>)

## flush

Flushes all queued events to the Marketing Cloud servers immediately.

### Syntax

```dart
SFMCSdkModule.flush();
```

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.flush();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk/-s-f-m-c-sdk/-companion/flush.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Classes/SFMCSdk.html#/c:@CM@SFMCSDK@objc(cs)SFMCSdk(cm)flush>)

## setLogging

Sets the log level for the native Marketing Cloud SDK.

### Syntax

```dart
SFMCSdkModule.setLogging(level);
```

### Parameters

| Parameter | Type       | Description                                                                                                   |
| --------- | ---------- | ------------------------------------------------------------------------------------------------------------- |
| `level`   | `LogLevel` | The SDK log level. Valid values are `LogLevel.debug`, `LogLevel.warn`, `LogLevel.error`, and `LogLevel.none`. |

### Returns

- `Future<void>`

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
await SFMCSdkModule.setLogging(LogLevel.debug);
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk.components.logging/-log-level/index.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Classes/SFMCSdk.html#/c:@M@SFMCSDK@objc(cs)SFMCSdk(cm)setLoggerWithLogLevel:logOutputter:>)

## getSdkState

Returns the SDK state for diagnostics.

### Syntax

```dart
SFMCSdkModule.getSdkState();
```

### Returns

- `Future<dynamic>` - A future that completes with the state of the SDK. The state is usually returned as a `Map<dynamic, dynamic>` object, but the native SDK can emit non-strict JSON that fails to parse. In this situation, the SDK returns the raw JSON string instead. Parse the result in a way that can handle both object types.

### Example

```dart
import 'package:sfmc_core/sfmc_core.dart';

await SFMCSdkModule.requestSdk();
final state = await SFMCSdkModule.getSdkState();
```

### See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/SFMCSdk/11.0/sfmcsdk/com.salesforce.marketingcloud.sfmcsdk/-s-f-m-c-sdk/get-sdk-state.html)
- [iOS SDK Reference](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/%3Chttps://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/appledocs/SFMCSdk/11.0/Classes/SFMCSdk.html#/c:@M@SFMCSDK@objc(cs)SFMCSdk(cm)state>)
