Client SDK for the ASK IT Auth Server — a lightweight, fully-typed TypeScript library that wraps the Auth Server REST API. It provides easy authentication flows (login, register, email verification, password reset) with automatic JWT token management and role helpers. v1.0.0 is the current stable version, released as a single package with no dependencies. Works in Node.js, browsers, and modern JavaScript runtimes. Key differentiators: ESM-only, built-in token storage, explicit error handling via AuthError class, and TypeScript-first design.
npm install askit-auth-sdkVerified import paths — ran on the pinned version, not inferred.
Creates an AskITAuth client, logs in with email/password, stores the JWT automatically, and retrieves the current user profile.
Manually call auth.setToken(token) with a stored token on app load, or implement your own persistence layer.
Ensure the baseUrl does not end with '/'. Example: 'https://auth.askaihk.com', not 'https://auth.askaihk.com/'.
Update to v1.0.0 and catch AuthError instead of Error for API errors.
Uninstall 'askit-auth-sdk' and install '@askit/auth-sdk'.
Run `npm install @askit/auth-sdk` and ensure tsconfig.json includes `"moduleResolution": "node"` or `"bundler"`.
Change `const AskITAuth = require('@askit/auth-sdk')` to `import { AskITAuth } from '@askit/auth-sdk'`.Create an instance first: `const auth = new AskITAuth({ baseUrl: '...' });` then call `auth.login(...)`.No dependency data recorded yet.