@synqauth/plugin-passkey
v0.3.0
Published
A Synq plugin for passkeys from your own UI.
Readme
@synqauth/plugin-passkey
A Synq plugin for passkeys from your own UI.
Synq is customer identity for businesses: an OpenID Connect issuer for each of your brands, with Solana wallet, social, email and passkey sign-in. The documentation is at docs.synq.build.
This package is at 0.x, so a minor release can change its API: see its CHANGELOG.md.
Usage
Passkeys from your own UI, with every ceremony at your brand's Synq issuer, which verifies them. Nothing is verified on your server.
import { passkeyPlugin } from '@synqauth/plugin-passkey'
import { SynqProvider, usePlugin } from '@synqauth/react'
const passkey = passkeyPlugin()
// <SynqProvider plugins={[passkey]}> ... then, in a component:
const { signIn, signInUrl, addUrl, list, remove } = usePlugin(passkey)
const { data, error } = await signIn({ returnTo: '/account' })
if (data) location.assign(data.signedIn ? data.returnTo : data.url)signIn() asks for the passkey right on your page when the app has own-UI sign-in on and the browser can use the brand's passkeys there. Otherwise it answers the URL of the hosted page's passkey step, the same URL signInUrl() gives.
list() and remove(id) go through your @synqauth/nextjs route mount's account API and answer { data, error }.
License
MIT
