Integrate Stories Widget SDK in Svelte / SvelteKit
Published on August 20, 2025
1. Introduction
Load the SDK in index.html
for Svelte or via onMount
in SvelteKit layouts. No target container or extra JS initialization needed.
2. Prerequisites
- Svelte or SvelteKit project
- Organization ID
- SDK URL, e.g.
https://cdn.usemevo.com/story-sdk.min.js
3. Step-by-Step Instructions
Svelte (Vite)
<!-- index.html -->
<div id="app"></div>
<script src="https://cdn.usemevo.com/story-sdk.min.js" id="YOUR_ORG_ID" defer></script>
SvelteKit
<!-- src/routes/+layout.svelte -->
<script>
import { onMount } from 'svelte';
onMount(() => {
const s = document.createElement('script');
s.src = 'https://cdn.usemevo.com/story-sdk.min.js';
s.defer = true;
s.id = 'YOUR_ORG_ID';
document.body.appendChild(s);
});
</script>
<slot />
4. Verification
- Run the dev server and open the page; stories should render.
5. Troubleshooting
- SSR issues: load the script in
onMount
(client only). - CSP/mixed content: use HTTPS and correct CSP headers.
- If widget doesn’t appear, verify the Organization ID and that the script loaded.
Add Stories to Svelte / SvelteKit
Embed a fast, elegant stories widget into your Svelte app.