Zero-dependency frontend and server SDK for HVT.
This repository contains the standalone TypeScript client for the HVT authentication platform.
- Main app: hvts.app
- Direct API base URL: api.hvts.app
- Docs: docs.hvts.app
- Backend API and platform code: markodera/hvt
- SDK issues: markodera/hvt-sdk/issues
npm install @hvt/sdkFrom the repository root:
node ./scripts/build.mjsThe build copies src/index.js and src/index.d.ts into dist/.
import { HVTClient } from "@hvt/sdk";
const client = new HVTClient({
baseUrl: "http://localhost:8000",
});
const session = await client.auth.login({
email: "owner@example.com",
password: "password123",
});
client.setAccessToken(session.access);
const org = await client.organizations.current();
const users = await client.users.list({ page_size: 25 });const client = new HVTClient({
baseUrl: "http://localhost:8000",
apiKey: "hvt_test_xxx",
});
const providers = await client.runtime.socialProviders();
const session = await client.runtime.login({
email: "customer@example.com",
password: "password123",
});- JWT takes priority over
X-API-Keyif both are sent. Do not send both at once. - Cookie auth is supported. The client defaults to
credentials: "include". - Runtime auth requires the
auth:runtimescope. - Failed refreshes clear the in-memory access token and dispatch
auth:logoutby default so apps can react consistently. - If you are integrating from a language without an SDK, call the HTTP API directly at
https://api.hvts.app.
AGPL-3.0-only. See LICENSE.