Get Profile
Reads the current marketing profile from the app.
Description
The getProfile helper reads the current marketing profile JSON stored by the app.
Use it to restore previously saved attributes before updating them.
Function Signature
const profile = await Superfans.helpers.marketing.getProfile();| Parameter | Type | Required | Description |
|---|---|---|---|
| Nil | Nil | Nil | This helper does not require any parameter. |
Structure of Response
A JSON object of marketing attributes. The keys depend on what the app has stored.
| Status | Response |
|---|---|
| Success | Marketing profile JSON object |
| Unexpected Error | { "status": "error", "errorId": 500, "errorHandle": "unknown-error", "message": "Something unexpected happened" } |
Example Usage
try {
const profile = await Superfans.helpers.marketing.getProfile();
} catch (error) {
await Superfans.actions.showToast({
title: "Something went wrong",
message: "Please try again."
});
}Best Practices
- Read the profile before calling
updateProfileso you can merge new attributes instead of overwriting unknown keys. - Handle errors with
try/catchand show a toast for user-facing failures.
Caveats
- The returned object is app-specific. Do not assume a fixed set of keys.
- This helper is read-only; use
Superfans.helpers.marketing.updateProfileto write attributes.
Updated about 7 hours ago
Did this page help you?