The current EdgeSpark scaffold usesDocumentation Index
Fetch the complete documentation index at: https://docs.edgespark.dev/llms.txt
Use this file to discover all available pages before exploring further.
@edgespark/web for frontend auth and API calls. It is a browser-only, same-origin SDK with cookie-based sessions, a managed auth UI, and a typed fetch wrapper for your app routes.
Create the browser client
The scaffold already creates a singleton inweb/src/lib/edgespark.ts:
web/src/lib/edgespark.ts
createEdgeSpark() takes no options. It always uses the current page origin and always sends cookie credentials.
Mount the managed auth UI
Useclient.authUI.mount(...) when you want EdgeSpark to handle sign-in, sign-up, email verification, OAuth entry points, and password reset UI for you.
Redirect mode
Use redirect mode for a dedicated/login page:
web/src/pages/LoginPage.tsx
/dashboard.
Controlled mode
Use controlled mode when the app owns the next step, such as closing a modal or navigating with a client router:web/src/components/AuthModal.tsx
Use headless auth methods
You can also call auth methods directly when you want custom forms:web/src/lib/auth.ts
client.auth.getSession()for nullable session readsclient.auth.requireSession()for route guards that should throw when logged outclient.auth.onSessionChange(...)for hydration-safe session subscriptionsclient.auth.signOut()for logout
Call your protected APIs
Useclient.api.fetch(...) for same-origin app requests:
web/src/lib/load-posts.ts
Let auth config drive the UI
The managed auth UI reads your project’s current auth configuration automatically. That means:- enabled OAuth providers appear automatically
- sign-up availability follows
disableSignUp - email verification and password reset behavior follow
configs/auth-config.yaml
See also
web reference
The browser SDK reference for
@edgespark/web, including auth, authUI, and api.fetch.Manage auth configuration
Configure providers, sign-up policy, session settings, vars, and secret refs in
configs/auth-config.yaml.