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();
ParameterTypeRequiredDescription
NilNilNilThis helper does not require any parameter.

Structure of Response

A JSON object of marketing attributes. The keys depend on what the app has stored.

StatusResponse
SuccessMarketing 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

  1. Read the profile before calling updateProfile so you can merge new attributes instead of overwriting unknown keys.
  2. Handle errors with try/catch and show a toast for user-facing failures.

Caveats

  1. The returned object is app-specific. Do not assume a fixed set of keys.
  2. This helper is read-only; use Superfans.helpers.marketing.updateProfile to write attributes.

Did this page help you?