Skip to main content

Segments API

Integration of segments through SDK. Methods of operation.

List of methods

Properties:

Checks:

Events:

Properties

List of segments

FREE

You have access to the entire list of segments at once when the game starts and the player loads, in the format of a string array.

ss.segments.list;

Example content:

['HAS_PAYMENTS', 'VIP', 'NEWBLE', 'VERY_ACTIVE'];

Checks

Segment check

ss.segments.has(tag) FREE

// By Tag
const hasPayments = ss.segments.has('HAS_PAYMENTS');

// Check
if (hasPayments) {
// Player is in the HAS_PAYMENTS segment
}

Events

Enter segment

The callback returns the segment tag as a string:

ss.segments.on('enter', (segmentTag) => {
// player entered the segment
});

Leave segment

The callback returns the segment tag as a string:

ss.segments.on('leave', (segmentTag) => {
// player left the segment
});

Stay in Touch

Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.

SpellSync Community Telegram: @spellsync.

For your suggestions e-mail: [email protected]

We Wish you Success!