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]

    GamePathDescription
    Memorize/embed/memorizeType digits of Pi from memory
    Quiz/embed/quizMultiple-choice Pi trivia questions
    Birthday Finder/embed/birthday-finderFind your birthday in Pi digits
    Countdown/embed/countdownLive countdown to Pi Day
    Daily Fact/embed/daily-factDaily rotating Pi fact card
    Leaderboard/embed/leaderboardTop Pi memorizers worldwide

    Query Parameters

    Append query parameters to customize the embed appearance.

    ParameterValuesDefaultDescription
    themelight, darklightColor scheme of the game UI
    hideHeadertrue, falsefalseHides the PracticePi branding header
    colorAny hex (no #)5046e5Primary accent color
    schoolschool slugPre-selects school for leaderboard
    Example: Dark theme with custom color
    <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:

    Response headers on /embed/* routes
    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.

    Auto-resize listener
    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:

    Message payload
    {
      "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-motion media query
    • Supports prefers-color-scheme for auto dark mode

    Browser Compatibility

    BrowserMin VersionStatus
    Chrome90+✅ Full support
    Firefox88+✅ Full support
    Safari14+✅ Full support
    Edge90+✅ Full support
    Chrome (Android)90+✅ Full support
    Safari (iOS)14+✅ Full support
    Internet Explorer❌ Not supported

    Changelog

    2.4.0

    2026-02-24

    • Added embed health monitoring system
    • Public status page at /status
    • Automated alerting for embed outages
    2.3.0

    2026-02-20

    • School showcase gallery
    • Web admin landing page
    • IT approval package
    2.2.0

    2026-02-15

    • Added postMessage auto-resize support
    • WordPress Gutenberg block plugin
    • Platform-specific how-to guides
    2.1.0

    2026-02-01

    • Dark theme support for embeds
    • Custom color parameter
    • Embed analytics tracking
    2.0.0

    2026-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