Skip to content

Feat/lms embed - #25

Merged
Mahakisore7 merged 2 commits into
mainfrom
feat/lms-embed
Oct 2, 2026
Merged

Mahakisore7 merged 2 commits into
mainfrom
feat/lms-embed

Conversation

@Mahakisore7

Copy link
Copy Markdown
Contributor

Phase

No phase doc: enterprise readiness (learners stay inside the institute's LMS).

Summary

  • /embed/ask asks the published library; /embed/ask?session=<id> asks one session (unlisted too; trials never). Optional theme=light|dark.
  • The only framable route: every other page keeps X-Frame-Options: DENY and frame-ancestors 'none'. /embed/* gets frame-ancestors https:, or the EMBED_FRAME_ANCESTORS list to restrict it to an institute's LMS.
  • No site header or footer in the embed (SiteChrome); links open in a new tab; the page posts { type: "pravaha:height", height } so hosts can auto-size the frame.
  • Studio: "Embed Ask in your LMS" (library) and "Embed" per ready session, with Copy code and Preview.
  • docs/EMBED.md (snippet, Moodle/Canvas/Sites, sizing script, security, rate-limit note); SECURITY.md, README and .env.example updated. Unit tests for the snippet, including title escaping.

How to verify

  1. curl -sI <preview>/embed/ask → no X-Frame-Options, CSP frame-ancestors https:; curl -sI <preview>/ → DENY and frame-ancestors 'none'.
  2. Studio → Sessions → "Embed Ask in your LMS": copy the code, paste it into any HTTPS page (or an LMS): the Ask box loads without the site header.
  3. Click the session title inside the embed: it opens in a new tab.
  4. <preview>/embed/ask?session=not-a-uuid → "This session isn't available to ask."

Checklist

  • Meets the linked phase doc's acceptance criteria (n/a: verified in a framed page on the preview)
  • Tests added/updated per the phase doc (tests/unit/embed.test.ts)
  • pnpm lint, pnpm typecheck, pnpm test pass
  • No secrets or .env values in this diff
  • Docs made inaccurate by this change are updated in this PR
  • No AI attribution in commits or this description (docs/GIT_WORKFLOW.md)

…embed codes

/embed/ask asks the published library, ?session=<id> one session. It is the only framable route; every other page keeps X-Frame-Options DENY and frame-ancestors 'none'. EMBED_FRAME_ANCESTORS narrows who may frame it. Links open in a new tab and the page posts its height to the host. Studio gets a copy-paste iframe per session and for the library. docs/EMBED.md.
@vercel

vercel Bot commented Oct 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pravaha Ready Ready Preview Oct 2, 2026 7:10pm UTC

@Mahakisore7
Mahakisore7 merged commit 1e23f3c into main Oct 2, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — fd35226e Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant