Integration Guide
Learn how to integrate RecapKit into your application
Quick Start
Get up and running in under 5 minutes with our SDK or iframe embed.
1
SDK Usage (ES Module)
Import the SDK and render stories directly in your React or vanilla JavaScript app.
import { renderStory } from "wrapped-story-sdk";
// Your story data
const storyData = {
version: "1.0",
slides: [
{
id: "1",
type: "stat",
title: "Your Activity",
stats: { "Tasks Completed": 42 }
}
]
};
// Render the story
renderStory({
elementId: "wrapped-container",
storyData,
theme: {
colors: {
primary: "#10B981",
background: "#111827"
}
}
}); Note: Include a
div
with
id="wrapped-container"
in your HTML.
2
iFrame Embedding
Embed stories using an iframe by passing your data URL as a query parameter.
<iframe
src="https://yourapp.vercel.app/story?dataUrl=https://api.yourapp.com/story.json"
width="100%"
height="600"
style="border: none; border-radius: 12px; max-width: 500px;"
title="Wrapped Story"
></iframe> Requirements:
-
Replace
yourapp.vercel.appwith your actual deployment URL -
The
dataUrlmust be a publicly accessible JSON endpoint - Your server must have proper CORS headers configured
3
JSON Data Format
Your story data should follow this structure:
{
"version": "1.0",
"slides": [
{
"id": "1",
"type": "image",
"title": "Welcome!",
"description": "Your quarterly recap",
"imageUrl": "https://example.com/hero.jpg"
},
{
"id": "2",
"type": "stat",
"title": "Your Metrics",
"description": "You've been productive!",
"stats": {
"Tasks Completed": 42,
"Projects Launched": 5
}
},
{
"id": "3",
"type": "summary",
"title": "That's Your Quarter!",
"description": "Keep up the great work!"
}
],
"theme": {
"colors": {
"primary": "#10B981",
"secondary": "#3B82F6",
"background": "#111827",
"text": "#FFFFFF"
},
"fontFamily": "Inter, sans-serif",
"transitionStyle": "fade",
"borderRadius": "1.5rem"
}
} Slide Types
-
image— Full-screen image with title and description -
stat— Display key metrics and statistics -
summary— Summary or closing slide -
default— Generic content slide
Need help with integration? We're here to help.
Contact Support