Skip to main content
The SDK emits events when things happen inside the EPIS iframe. Register handlers with EPIS.on() to react in your own UI.

Quick reference


ready

Fires when an EPIS iframe has finished loading and is ready to receive messages.
ready fires per-mount, not once globally. If you mount more than one instance, you’ll receive one ready event per mount.

auth

Fires when a user successfully authenticates with PastpaperLM.
Common uses:
  • Show a welcome message in your app’s header
  • Track signups in your own analytics
  • Unlock EPIS-specific UI elements

auth-error

Fires when auth fails or is cancelled.
Error codes:

message

Fires each time EPIS completes a full response (after streaming finishes).
content is the complete final response, not individual streaming tokens. If you need streaming token-level access, that is not currently available via the SDK event system.

error

Fires on runtime errors inside the embed — network failures, API errors, etc.

unmount

Fires when a mount is removed via EPIS.unmount() or EPIS.unmountAll().

Removing listeners

Pass the same function reference to off():
Arrow functions assigned to variables work too:
Anonymous arrow functions cannot be removed: