Quick Start
The simplest way to embed a thread is using an iframe with the thread iframe URL:abc123 with your thread ID (obtained from the GET /api/threads endpoint).
Iframe Attributes
Required Attributes
The thread iframe URL:
https://app.kash.bot/threads/{threadId}/iframeRecommended Attributes
Iframe width - use
100% for responsive designIframe height in pixels (minimum 400px recommended)
Border width (set to
0 for seamless embed)Allow fullscreen mode for market charts
Use
eager for above-fold embeds, lazy for below-foldAccessibility: describe the iframe content for screen readers
Query Parameters
Source identifier for revenue tracking (e.g., your domain name). Recommended for proper attribution.
Complete Example
Here’s a fully configured iframe embed:- Embeds thread
abc123with the 20-tile market heatmap - Tracks source as
example.comfor revenue sharing - Displays thread title, description, and stats
- Users can click any tile to view market details in a new tab
- Predictions are made via Twitter (no login required in the iframe)
Responsive Design
Using CSS for Responsiveness
Wrap the iframe in a responsive container:Mobile-Responsive Height
Adjust iframe height for different screen sizes using CSS media queries:Security Considerations
Sandbox Attribute
Use thesandbox attribute to restrict iframe capabilities:
allow-scripts- Required for embed functionalityallow-same-origin- Allows API calls to Kash backendallow-popups- Enables market detail modalsallow-forms- Allows trading form submissions
Content Security Policy (CSP)
If your site uses CSP headers, add Kash to allowed sources:Finding Thread IDs
Use the GET /api/threads endpoint to discover thread IDs:Performance Best Practices
1. Lazy Loading
Load below-fold iframes only when visible:2. Preconnect to Kash Domain
Speed up iframe loading with DNS preconnect:Accessibility
Provide Descriptive Title
Help screen reader users understand iframe content:Keyboard Navigation
Kash embeds support full keyboard navigation:- Tab - Navigate between markets
- Enter - Open market details
- Escape - Close modals
ARIA Labels
The iframe automatically includes ARIA labels for interactive elements within the embed.Common Issues
Iframe Not Displaying
Problem: Blank iframe or “Refused to display” error Solutions:- Verify thread ID is correct
- Ensure URL uses the
/iframeroute:https://app.kash.bot/threads/{id}/iframe - Check browser console for CSP errors
- Confirm parent page is served over HTTPS (required)
Height Not Correct
Problem: Iframe shows scrollbars or cuts off content Solutions:- Set appropriate height:
height="900"for threads,height="500"for markets - Use CSS media queries to adjust height for different screen sizes
- Test on multiple devices and screen sizes
Markets Not Loading
Problem: Embed loads but shows no markets Solutions:- Check thread has active markets using GET /api/threads/:id/markets
- Verify the thread ID is correct and the thread is active