Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Actito scripts

Reference of the Actito profile mapper script, extensions.actito.profile.mapper: registration, the MapFromActitoProfiles handler and an example.

The Actito connector copies firstName and lastName from an Actito profile onto the wallet account. The profile mapper script adds the other Actito attributes a pass needs, such as a segmentation tier or a preferred store. This page is the reference for extensions.actito.profile.mapper. The connector itself is described on the Actito connector page; the rules shared by every connector script are in Connector scripts.

Real-world examples
  • A retailer shows the loyalty tier stored in an Actito profile column on the pass.

  • A brand copies the preferred store of the Actito profile onto the account, so that the pass shows the store data.

Registration

Key

Slot file

Methods (required in bold)

extensions.actito.profile.mapper

actito.profile.mapper.js

MapFromActitoProfiles

The file sits in server/scripts/. The slot is the Profile mapper script of the Advanced tab of the Actito connector settings, read and written with GET and PUT /api/{tenantId}/admin/extensions/actito/scripts. When no script is registered, the default mapping applies: firstName and lastName only.

export default function (context) {
  context.register('extensions.actito.profile.mapper', {
    MapFromActitoProfiles: (data, account) => {}
  });
}

When it runs

The connector calls the mapper each time its customer provider (actito.profile) reads an Actito profile to fill the account, right after it has copied firstName and lastName when the profile carries them. The provider reads nothing, and the mapper does not run, when the account has no id.actito.profileId identifier. The mapper has one direction only, from Actito to the account. Writing to Actito is not done by this script.

Handlers

Method
Parameters
Returns
Required
Sync or async

MapFromActitoProfiles

data, account

nothing

Required

Synchronous

  • data holds every attribute of the Actito profile, each value as a string. The keys are the column names of the Actito profile table named in Profile table name in the connector configuration.

  • account is the wallet account, a flat dictionary (see Data objects). The script writes the keys it wants to publish and changes nothing else.

The method returns nothing: it changes account in place.

Errors and edge cases

  • No script registered: the default mapping applies and nothing is logged as an error.

  • The method is missing from the registered object: the call fails with method MapFromActitoProfiles missing when the connector reaches it.

  • An attribute is absent from the profile: data['column'] reads as undefined. Test it before copying it.

  • The script throws: the error fails the read of the Actito profile, and with it the customer provider entry that called it.

  • The handler is declared async: it is not awaited, so changes made after an await are lost.

Example

The script keeps the default mapping and adds a tier and a preferred store. Both are copied only when the profile carries them, so that a missing column never erases a value another provider wrote.

The column names loyaltyTier and preferredStore are placeholders: use the names of the brand's own Actito table.

Common pitfalls

  • The registration lines of the starter script are still commented out, so the default mapping applies.

  • The column name is typed with another case than in Actito: the attribute reads as undefined.

  • The mapper expects a number or a boolean: every value of data is a string.

FAQ

Can the mapper write back to Actito?

No. It runs when the profile is read. The wallet installation status is written to Actito by the connector itself, without a script.

Last updated