Embedding (SDK)
Embed Deckyard presentations in external websites and applications.
Overview
Section titled “Overview”The Deckyard SDK allows you to embed interactive presentations in your own website or application. Viewers can navigate slides, interact with polls and Q&A, and enjoy the full presentation experience.

Basic Embed
Section titled “Basic Embed”Include the SDK
Section titled “Include the SDK”Add the embed SDK script to your page:
<script src="https://your-instance.com/embed-sdk.js"></script>Create the Embed
Section titled “Create the Embed”<div id="presentation"></div><script> const embed = PresentationSystemEmbed.createDeckEmbed({ el: document.getElementById('presentation'), publishId: 'ABC123' });</script>The publishId is the 6-character code from your published presentation URL.
SDK Options
Section titled “SDK Options”Full Options Example
Section titled “Full Options Example”const embed = PresentationSystemEmbed.createDeckEmbed({ el: document.getElementById('presentation'), publishId: 'ABC123', options: { // Base URL (defaults to current origin) baseUrl: 'https://your-instance.com',
// Slug for prettier URLs slug: 'quarterly-review',
// Show navigation controls (default: true) controls: true,
// Starting slide index (default: 0) start: 0,
// Loop at the end (default: false) loop: false,
// Allow fullscreen button (default: true) allowFullscreen: true,
// UI mode: "default" or "min" (minimal) ui: 'default',
// Aspect ratio (default: 16/9) aspectRatio: 16/9,
// Language: 'nl' or 'en-GB' lang: 'en-GB',
// Show language switcher in embed langSwitch: false,
// Allowed origins for postMessage (default: current origin) allowedOrigins: ['https://your-site.com'],
// Accessibility title for iframe title: 'Quarterly Review Presentation',
// Event callbacks onReady: (payload) => console.log('Ready', payload), onSlideChange: (payload) => console.log('Slide changed', payload), onError: (payload) => console.log('Error', payload) }});Options Reference
Section titled “Options Reference”| Option | Type | Default | Description |
|---|---|---|---|
baseUrl | string | Current origin | Instance URL |
slug | string | - | URL slug for the presentation |
controls | boolean | true | Show navigation controls |
start | number | 0 | Starting slide index |
loop | boolean | false | Loop back to start at end |
allowFullscreen | boolean | true | Allow fullscreen mode |
ui | string | ”default” | UI mode (“default” or “min”) |
aspectRatio | number | 16/9 | Embed aspect ratio |
lang | string | - | Force language (“nl” or “en-GB”) |
langSwitch | boolean | false | Show language switcher |
title | string | ”Embedded presentation” | Iframe title for accessibility |
Responsive Embedding
Section titled “Responsive Embedding”The embed automatically maintains aspect ratio. Wrap it in a container to control width:
<style> .embed-container { max-width: 800px; margin: 0 auto; }</style>
<div class="embed-container"> <div id="presentation"></div></div>Full-Width Embed
Section titled “Full-Width Embed”.embed-container { width: 100%;}Fixed Size
Section titled “Fixed Size”.embed-container { width: 640px;}The height is automatically calculated based on the aspect ratio.
Controller API
Section titled “Controller API”The createDeckEmbed function returns a controller object:
Navigation Methods
Section titled “Navigation Methods”const embed = PresentationSystemEmbed.createDeckEmbed({ ... });
// Go to next slideembed.next();
// Go to previous slideembed.prev();
// Jump to specific slide (0-indexed)embed.goToSlide(5);State Methods
Section titled “State Methods”// Get current stateconst state = embed.getState();// Returns: { slideIndex, slideId, totalSlides, publishId }Cleanup
Section titled “Cleanup”// Remove the embed and clean up event listenersembed.destroy();Event Handling
Section titled “Event Handling”Callback Options
Section titled “Callback Options”Pass callbacks in the options object:
PresentationSystemEmbed.createDeckEmbed({ el: document.getElementById('presentation'), publishId: 'ABC123', options: { onReady: (payload) => { console.log('Total slides:', payload.totalSlides); }, onSlideChange: (payload) => { console.log('Now on slide:', payload.slideIndex); }, onError: (payload) => { console.error('Error:', payload); } }});Event Listeners
Section titled “Event Listeners”Or use the event emitter pattern:
const embed = PresentationSystemEmbed.createDeckEmbed({ ... });
// Subscribe to eventsconst unsubscribe = embed.on('slidechange', (payload) => { console.log('Slide changed:', payload);});
// Unsubscribe when doneunsubscribe();
// Or use off()embed.off('slidechange', handler);DOM Events
Section titled “DOM Events”Events are also dispatched on the wrapper element:
const wrapper = embed._wrapper;wrapper.addEventListener('slidechange', (event) => { console.log('Slide:', event.detail.slideIndex);});Available Events
Section titled “Available Events”| Event | Payload | Description |
|---|---|---|
ready | { totalSlides } | Embed loaded and ready |
slidechange | { slideIndex, slideId } | Slide navigation occurred |
state | { slideIndex, slideId, totalSlides } | State update |
error | { message } | Error occurred |
Security Considerations
Section titled “Security Considerations”Origin Validation
Section titled “Origin Validation”The embed iframe validates its parent origin using allowedOrigins:
PresentationSystemEmbed.createDeckEmbed({ el: document.getElementById('presentation'), publishId: 'ABC123', options: { allowedOrigins: [ 'https://your-site.com', 'https://staging.your-site.com' ] }});By default, only the current origin is allowed.
Iframe Sandbox
Section titled “Iframe Sandbox”The embed uses standard iframe security:
referrerPolicy="strict-origin-when-cross-origin"- Fullscreen permission controlled via
allowattribute - No access to parent page DOM
Always serve embeds over HTTPS in production for security.
Troubleshooting
Section titled “Troubleshooting”Embed Not Loading
Section titled “Embed Not Loading”- Check that the presentation is published
- Verify the
publishIdis correct - Check browser console for errors
- Ensure the SDK script is loaded
Navigation Not Working
Section titled “Navigation Not Working”- Verify
controls: truein options - Check that
allowedOriginsincludes your domain - Look for JavaScript errors in console
Responsive Issues
Section titled “Responsive Issues”- Ensure container has defined width
- Check for CSS conflicts with
.ps-embed-wrap - Verify
aspectRatiooption is set correctly