on / off) return this — the SDK instance — making them chainable.
EPIS.mountChat()
selector. The mounted iframe connects to embed.pastpaperlm.com/embed/chat.
What the mount includes:
- Full conversation UI with streaming AI responses
- File attachment support — images, PDFs (via Cloudinary pipeline)
- “Authenticate with PastpaperLM” flow if no active session
- Session persistence across page reloads (token in iframe’s
localStorage) - Past paper retrieval — free 4-year window for all users
string
required
A CSS selector string (e.g.
'#epis-chat', '.epis-container'). The SDK calls document.querySelector(selector) internally.Partial<EpisBoxConfig>
Per-mount overrides for
theme, locale, model, or persona. These are merged on top of the config passed to init().EPIS.updateTheme()
init().
Accepts the same shape as config.theme passed to init(), including preset.
Mounted iframes must have already sent their
ready event before an update is delivered — calling this immediately after mountChat() on the very first paint may be a no-op. In practice this is never an issue for toggles fired later by user interaction.EPIS.unmount()
selector. Destroys the iframe, cleans up internal event listeners, and marks the selector as available for remounting.
EPIS.unmountAll()
init() state. After calling this, you must call EPIS.init() again before mounting.
EPIS.on()
this for chaining. See the Events reference for all event names and payload shapes.
EPIS.off()
callback reference must be the same function passed to on().
EPIS.VERSION
EPIS.THEMES
'dark', 'light', 'auraspace', 'minimal'). Useful for building a theme picker or for debugging.