Skip to main content
All methods (except on / off) return this — the SDK instance — making them chainable.

EPIS.mountChat()

Mounts the full EPIS Chat UI into the element matching 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
Calling mountChat() on a selector that is already mounted logs a warning and does nothing. To remount with different options, call unmount(selector) first.
Parameters:
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()

Pushes a live theme update to every currently mounted instance without unmounting or remounting them — no flicker, no lost conversation state. Use this to keep EPIS in sync when your own app’s light/dark toggle (or any other theme change) happens after 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()

Removes the EpisBox mount at selector. Destroys the iframe, cleans up internal event listeners, and marks the selector as available for remounting.

EPIS.unmountAll()

Removes all active mounts and resets the SDK to its pre-init() state. After calling this, you must call EPIS.init() again before mounting.

EPIS.on()

Register an event listener. Returns this for chaining. See the Events reference for all event names and payload shapes.

EPIS.off()

Remove a specific event listener. The callback reference must be the same function passed to on().

EPIS.VERSION

Read-only. The current SDK version string.

EPIS.THEMES

Read-only object containing the full config for every named preset ('dark', 'light', 'auraspace', 'minimal'). Useful for building a theme picker or for debugging.

Chaining example