π― Live Widget Demo
Story circles will appear below (loaded from API):
π Reinitialize
βΆοΈ Play
βΈοΈ Pause
β Close
π Navigate to Story 2
ποΈ Destroy
π» Integration Code
Simple Web Component Integration
<!-- Load the SDK -->
<script src="https://cdn.storyfyd.com/sdk/storyfyd-web.js"></script>
<!-- Add the widget -->
<storyfyd-web></storyfyd-web>
<script>
const storyfydWeb = document.querySelector('storyfyd-web');
storyfydWeb.init({
token: 'YOUR_TOKEN',
apiBaseUrl: 'https://api.storyfyd.com',
debug: true,
layout: {
view: 'classic',
style: {
width: '80px',
height: '80px'
}
},
onReady: () => console.log('Ready!'),
onStoryOpen: (data) => console.log('Story opened', data),
onStoryClosed: () => console.log('Story closed'),
onStoryChanged: (data) => console.log('Story changed', data),
onInteraction: (data) => console.log('Interaction', data),
onError: (error) => console.error('Error', error)
});
</script>