Placeholders
Placeholders let you dynamically replace text and image tokens inside story slides and templates with user-specific values (e.g. user name, avatar, promo code).
Setting placeholders at initialization
const storyManager = await StoryManager.create({
apiKey: '<your-api-key>',
placeholders: {
username: 'John Doe',
city: 'New York',
},
});
Updating text placeholders at runtime
storyManager.setPlaceholders({
username: 'Alex',
bonus_points: '1500',
});
Image placeholders
To dynamically replace image URLs inside slides:
storyManager.setImagePlaceholders({
avatar: 'https://example.com/user/avatar.png',
banner_bg: 'https://example.com/images/sale_banner.jpg',
});