@synqid/js.
The core SDK.
Framework-agnostic. Works in browser, Node, Bun, Deno, edge. Zero React dependency, ~8 kB gzipped. Use it directly when you're not on React — or import it as the engine under any other Synq SDK.
Install
pnpm add @synqid/js
# or
npm install @synqid/js
# or
bun add @synqid/jsUse it
Same shape across browser, server, and CLI — only the surface differs.
import { createSynqClient } from '@synqid/js'
const synq = await createSynqClient({
issuer: 'https://api.synq.id',
clientId: import.meta.env.VITE_SYNQ_CLIENT_ID,
redirectUri: `${location.origin}/auth/callback`,
})
// Open the hosted sign-in URL
await synq.signIn({ provider: 'google' })
// On the callback page
const session = await synq.handleCallback()Primitives, not opinions
SynqClient
Per-issuer client with discovery-doc caching. Handles auth-code + PKCE, refresh, revocation, and userinfo.
verifyAccessToken / verifyIdToken
JWT verification with cached JWKS. Drop-in on any backend that needs to authorize a Synq-issued token.
createDeviceFlow
Device authorization grant (RFC 8628). Polls for completion, returns a session. Works in any Node-shaped runtime.
getM2MToken
Client-credentials grant with in-memory caching and auto-refresh.
verifyWebhook (subpath import)
HMAC-SHA256 verification for webhook deliveries. Constant-time compare under the hood.
BroadcastChannel cross-tab sync
Multi-tab session sync via the standard BroadcastChannel API. One sign-in propagates to every open tab.
When to reach for something else
Common questions
The lowest-level SDK you'll ever need.
No React, no Next, no platform assumptions. Drop @synqid/js into anything that runs JS and ship sign-in.
