Skip to content

markodera/hvt-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

HVT TypeScript SDK

Zero-dependency frontend and server SDK for HVT.

This repository contains the standalone TypeScript client for the HVT authentication platform.

Install

npm install @hvt/sdk

Local Build

From the repository root:

node ./scripts/build.mjs

The build copies src/index.js and src/index.d.ts into dist/.

Usage

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 });

Runtime Auth with API Keys

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",
});

Development Notes

  • JWT takes priority over X-API-Key if both are sent. Do not send both at once.
  • Cookie auth is supported. The client defaults to credentials: "include".
  • Runtime auth requires the auth:runtime scope.
  • Failed refreshes clear the in-memory access token and dispatch auth:logout by 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.

License

AGPL-3.0-only. See LICENSE.

About

TypeScript/JavaScript SDK for HVT open-source authentication infrastructure (API client + helpers for integrating auth into apps)

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors