Package Exports
- @entityauth/auth-client
Readme
@entityauth/auth-client
Entity Auth client SDK for web/Node.
Install
pnpm add @entityauth/auth-clientUsage
import { EntityAuthClient } from '@entityauth/auth-client';
const ea = new EntityAuthClient({ baseURL: 'https://api.example.com' });
await ea.register({ email: 'a@b.com', password: 'secret', workspaceTenantId: 't1' });
await ea.login({ email: 'a@b.com', password: 'secret', workspaceTenantId: 't1' });
const me = await ea.getUserMe();
// Sessions
await ea.getCurrentSession();
await ea.listSessions();Cross-origin note (web)
The SDK sends fetch requests with credentials: 'include' so cookies can be used across origins. For cross-origin deployments, ensure your API sets the refresh cookie with SameSite=None; Secure and that CORS allows credentials.
API Surface
See repo docs for complete reference: Auth, Users, Orgs, Sessions, and Helpers.