@uniora/better-auth
v0.14.0
Published
Better Auth adapter for @uniora/core: turns a Better Auth session into an Identity
Maintainers
Readme
@uniora/better-auth
Better Auth identity adapter for UNIORA. It only answers "who is this?": it returns an Identity ({ provider, subject }), or null for anything it can't verify, and never throws into an access decision. What that identity may do is always decided by the AuthorizationEngine in @uniora/core.
npm install @uniora/core @uniora/better-authimport { resolveIdentity, toVerifiedEmail } from "@uniora/better-auth";
const identity = await resolveIdentity(auth.api.getSession, request.headers); // Identity | nulltoVerifiedEmail returns the address the provider has verified, or null. Pass it as verifiedEmail to invitations.accept(...) (never an address the user merely typed).
toProfile(user) returns { displayName, email, avatarUrl } (display data only, the avatar is just a URL) and resolveIdentityWithProfile(...) verifies once and returns { identity, profile }: pass them to createProfileSync(storage) from @uniora/core so Studio shows the person, not an id. See Identity adapters.
The adapter defines a minimal structural contract for your already-configured client, so it adds no dependency on the provider's SDK.
Documentation: Identity adapters guide and the full index.
License: PolyForm Shield 1.0.0.
