PracticePi Embed Documentation
Everything you need to embed PracticePi games on your website.
Embed URL Reference
All embeds are served from https://www.practicepi.com/embed/[game]
| Game | Path | Description |
|---|---|---|
| Memorize | /embed/memorize | Type digits of Pi from memory |
| Quiz | /embed/quiz | Multiple-choice Pi trivia questions |
| Birthday Finder | /embed/birthday-finder | Find your birthday in Pi digits |
| Countdown | /embed/countdown | Live countdown to Pi Day |
| Daily Fact | /embed/daily-fact | Daily rotating Pi fact card |
| Leaderboard | /embed/leaderboard | Top Pi memorizers worldwide |
Query Parameters
Append query parameters to customize the embed appearance.
| Parameter | Values | Default | Description |
|---|---|---|---|
theme | light, dark | light | Color scheme of the game UI |
hideHeader | true, false | false | Hides the PracticePi branding header |
color | Any hex (no #) | 5046e5 | Primary accent color |
school | school slug | — | Pre-selects school for leaderboard |
<iframe src="https://www.practicepi.com/embed/memorize?theme=dark&color=16a34a" width="100%" height="650" frameborder="0" allowfullscreen> </iframe>
HTTP Headers
PracticePi embed routes return the following headers to allow iframe embedding:
X-Frame-Options: ALLOWALL Content-Security-Policy: frame-ancestors * X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000
No CSP changes needed on your site. The embed does not load any scripts on your domain. It runs entirely within the sandboxed iframe.
postMessage API
The embed sends postMessage events for automatic height resizing.
window.addEventListener("message", function(e) {
if (e.data && e.data.type === "practicepi-embed-resize") {
var iframe = document.querySelector(
'iframe[src*="practicepi.com/embed/memorize"]'
);
if (iframe) {
iframe.style.height = e.data.height + "px";
}
}
});Message format:
{
"type": "practicepi-embed-resize",
"height": 720 // pixels
}Rate Limits & Caching
Embed pages are served via Cloudflare CDN with the following caching behavior:
- HTML pages are cached at the CDN edge for 5 minutes
- Static assets (JS, CSS) are cached for 1 year with content hashing
- API calls from within the embed have a rate limit of 100 requests/minute per IP
- No rate limit on the initial page load — CDN handles scaling
Privacy & Data Collection
PracticePi embeds collect zero personal data from visitors.
- No cookies are set on the embedding domain
- No user tracking or fingerprinting
- No data is sent to third-party analytics services
- Anonymous game scores may be sent to the PracticePi API for leaderboard display only
- No student names, emails, or identifiable information is ever collected through embeds
COPPA & FERPA Compliance
PracticePi does not collect personally identifiable information from children under 13. Our embeds are designed to be used in educational settings without requiring student accounts. No education records as defined by FERPA are accessed or stored through the embed system.
Accessibility (WCAG 2.1 AA)
- All interactive elements are keyboard navigable
- Color contrast ratios meet WCAG 2.1 AA standards (4.5:1 minimum)
- ARIA labels on all interactive components
- Focus indicators visible on all focusable elements
- Screen reader compatible with semantic HTML
- Supports
prefers-reduced-motionmedia query - Supports
prefers-color-schemefor auto dark mode
Browser Compatibility
| Browser | Min Version | Status |
|---|---|---|
| Chrome | 90+ | ✅ Full support |
| Firefox | 88+ | ✅ Full support |
| Safari | 14+ | ✅ Full support |
| Edge | 90+ | ✅ Full support |
| Chrome (Android) | 90+ | ✅ Full support |
| Safari (iOS) | 14+ | ✅ Full support |
| Internet Explorer | — | ❌ Not supported |
Changelog
2.4.02026-02-24
- Added embed health monitoring system
- Public status page at /status
- Automated alerting for embed outages
2.3.02026-02-20
- School showcase gallery
- Web admin landing page
- IT approval package
2.2.02026-02-15
- Added postMessage auto-resize support
- WordPress Gutenberg block plugin
- Platform-specific how-to guides
2.1.02026-02-01
- Dark theme support for embeds
- Custom color parameter
- Embed analytics tracking
2.0.02026-01-15
- Complete embed system rewrite
- Six game types available
- CDN delivery for global performance
Technical Support
For technical questions about embedding PracticePi:
General support: hello@practicepi.com
IT department inquiries: it@practicepi.com
Response time: within 24 hours on business days