Skip to main content
Get EPIS into your app in 3 minutes

One script tag. One container div. One initialization call. Your users get the full EPIS experience with zero backend setup.

Recommended: Integrate with your Agent

Skip the manual steps below — clone the repo, paste one prompt into any AI coding agent, and get this done for you. See how →
New to EpisBox? Read Concepts first — two minutes on why EpisBox is an iframe (not a library) and why auth uses tokens instead of cookies. It makes every edge case below make sense instead of feeling arbitrary.

Prerequisites

Client ID

A clientId issued by PastpaperLM. Email us to get one.

Container div

A <div> somewhere in your page with a defined height (600px, 100% with a sized parent, etc.).

A real HTTP(S) origin

Serve your page over http:// or https:// — opening the file directly (file://) will not work. See Local Development.

Step 1 — Load the SDK

Add this to your <head> or just before </body>. One tag. That’s it.
The SDK is served from Cloudflare’s global edge — cached at every PoP worldwide, immutable cache headers, versioned filename. It costs you one DNS lookup on first visit per user, then nothing.

Step 2 — Add containers

Place these <div>s wherever EPIS should appear — sidebar, full page, modal, anywhere:
The container must have a defined height. height: 100% works only if the parent has a fixed height. If EPIS appears as a 0px-height invisible element, this is why.

Step 3 — Initialize

Call EPIS.init() after the DOM is ready and mount into your containers:
Your clientId is public by design — like Google’s OAuth client_id. It identifies your app to our servers. There is no clientSecret on your side. Never treat it as sensitive.

What happens next

When a user reaches your page for the first time:
  1. The SDK script loads from cdn.pastpaperlm.com (edge-cached, ~5ms)
  2. EPIS.init() runs and mounts an iframe from embed.pastpaperlm.com
  3. The iframe checks for an existing PastpaperLM session in its own localStorage
  4. No session found → user sees “Authenticate with PastpaperLM” screen
  5. User clicks “Sign in with Google” → popup opens on pastpaperlm.com
  6. Auth completes → popup posts a token to the iframe → popup closes
  7. EPIS chat loads — user is now in
On return visits, step 4-6 are skipped. Token is already in the iframe’s localStorage. EPIS loads directly.
The auth popup runs entirely on pastpaperlm.com. Your users’ credentials never touch your domain.

Next steps

Integrate with your Agent (recommended)

Clone the repo, hand one prompt to any AI coding agent, and get a working integration without reading a line of this guide yourself.

Framework guides

Detailed integration guides for Vanilla JS, React, and SPA patterns.

Theming

Match EPIS to your brand colors with theme tokens and presets — or hand your brand description to our AI theming skill and get a config for free.

SDK Reference

Full API reference for every method, event, and config option.

Security model

Understand what’s isolated, what’s shared, and how auth works.

Troubleshooting

Blank embed, blocked popups, theme not applying — the fixes.