Configuration
Enable in-app messages when you initialize the SDK:Configuration Options
Enable or disable in-app message rendering entirely.
When
true, the SDK automatically fetches and displays pending messages for the identified user.How often (in seconds) the SDK polls for new messages.
A custom DOM element ID to use as the message container. When omitted, messages are appended to
document.body.Automatic Display
WhenautoDisplayMessages is true, the SDK runs the full message lifecycle without any additional code from you:
Fetch Pending Messages
After
identify() is called, the SDK fetches all messages the current user is eligible to receive.Evaluate Trigger Conditions
Each message is evaluated against its configured trigger — immediate display, a time delay, a specific event, or a page visit.
Display Ready Messages
Messages that pass their trigger conditions are rendered in the DOM using the configured message type and content blocks.
Track Interactions
message.viewed, message.clicked, and message.dismissed events are tracked automatically.Manual Control
If you need to manage message display yourself, setautoDisplayMessages: false and use the methods below.
Fetch Messages
Display a Specific Message
Display All Pending Messages
Dismiss a Message
Track a Message Event Manually
Message Types
The SDK renders three message types, each suited to different use cases:- Popup
- Modal
Message Blocks
Each message is composed of one or more content blocks. You configure these in the Tappd dashboard.Image Block
Image Block
Displays an image with alignment and sizing control.
| Property | Description |
|---|---|
url | Image URL |
alt | Alt text for accessibility |
width | Image width |
height | Image height |
alignment | left, center, right, or full |
Text Block
Text Block
Displays styled text content. The
content property supports basic HTML.| Property | Description |
|---|---|
content | Text content (supports basic HTML) |
fontSize | sm, base, lg, xl, 2xl, or a custom size |
fontWeight | normal or bold |
color | Hex, RGB, or named color |
alignment | left, center, right, or justify |
Button Block
Button Block
HTML Block
HTML Block
Injects raw HTML content. All content is sanitized before rendering.
| Property | Description |
|---|---|
content | Raw HTML string |
Event Tracking
The SDK automatically fires these events for every message interaction:| Event | When It Fires |
|---|---|
message.viewed | When a message is rendered and visible |
message.clicked | When a user clicks a button inside the message |
message.dismissed | When a user dismisses the message |
messageId property. Click events also include buttonText and buttonLink.