JSPM

  • Created
  • Published
  • Downloads 391
  • Score
    100M100P100Q96171F
  • License MIT

TypeScript/JavaScript client SDK for Entity Auth - complete authentication infrastructure with organizations, sessions, and real-time security

Package Exports

  • @entityauth/auth-client

Readme

@entityauth/auth-client

Entity Auth client SDK for web/Node.

Install

pnpm add @entityauth/auth-client

Usage

import { EntityAuthClient } from '@entityauth/auth-client';

const ea = new EntityAuthClient({ baseURL: 'https://api.example.com' });
await ea.register({ email: 'a@b.com', password: 'secret', tenantId: 't1' });
await ea.login({ email: 'a@b.com', password: 'secret', tenantId: '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.