InvergeDocs
JavaScriptAPI reference

In-app messages

In-app messages in the JavaScript SDK.

// access
nexus.inApp
SymbolKindSummary
NexusInAppclassIn-app messages — OneSignal-style modals & banners.
NexusInAppMessageinterface

NexusInApp

class

In-app messages — OneSignal-style modals & banners. Messages are composed in the console; this service fetches the ones a user is eligible for (server- driven / headless UIs) and records impressions and clicks.

NexusInApp

constructor
new NexusInApp(http: NexusHttp, id: NexusIdentity)

Parameters

Prop

Type

Returns NexusInApp

View source

active()

method
async active(options: { distinctId?: string } = {}): Promise<NexusInAppMessage[]>

The active in-app messages for the tenant.

Parameters

Prop

Type

Returns Promise<NexusInAppMessage[]>

View source

trackEvent()

method
async trackEvent(messageId: string, type: 'impression' | 'click' | 'dismiss', options: { buttonId?: string; distinctId?: string } = {}): Promise<void>

Record an in-app message event: impression, click, or dismiss.

Parameters

Prop

Type

View source

impression()

method
impression(messageId: string, options: { distinctId?: string } = {}): Promise<void>

Parameters

Prop

Type

View source

click()

method
click(messageId: string, buttonId: string, options: { distinctId?: string } = {}): Promise<void>

Parameters

Prop

Type

View source

dismiss()

method
dismiss(messageId: string, options: { distinctId?: string } = {}): Promise<void>

Parameters

Prop

Type

View source

NexusInAppMessage

interface

id

property
id: string

layout

property
layout: string

content

property
content: Record<string, unknown>

buttons

property
buttons?: unknown[]

On this page