@embeddables/admin
v0.0.3
Published
Admin SDK — email OTP and token-gated RPC for Embeddables brand dashboards.
Keywords
Readme
@embeddables/admin
Typed client for brand-admin login against the Embeddables backend. The SDK
never talks to Supabase — OTP and /admin/v1 methods go through that door;
operator experiment create goes through /experiments/v1/experiment.
Install
npm install @embeddables/adminQuick start
requestOtp, verifyOtp, and refresh are the embedded-UI reference for the
canonical operator login flow.
import { initAdmin } from '@embeddables/admin'
const admin = initAdmin()
await admin.requestOtp({ email: '[email protected]' })
const { token, expires_at, expires_in, admin_user } = await admin.verifyOtp({
email: '[email protected]',
token: '123456',
})
await admin.getSession()
await admin.listProjects()
await admin.refresh()
await admin.logout()Local API origin: set VITE_ADMIN_API_URL in the consuming app. Do not pass a
baseUrl to initAdmin.
