Package Exports
- @entityauth/auth-client
Readme
@entity/auth
TypeScript SDK for Entity Auth.
Install
pnpm add @entity/authUsage
import { EntityAuthClient } from '@entity/auth';
const ea = new EntityAuthClient({ baseURL: 'https://api.example.com' });
await ea.register({ email: 'a@b.com', password: 'secret', tenantId: 't1' });
const { accessToken } = await ea.login({ email: 'a@b.com', password: 'secret', tenantId: 't1', platform: 'web' });
await ea.refresh();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.