@magicauth/classic-sdk
v0.1.0
Published
TypeScript client for the classic MagicAuth vault, for Node and Cloudflare Workers
Maintainers
Readme
Classic MagicAuth SDK
@magicauth/classic-sdk: the TypeScript client products use to talk to the
classic MagicAuth vault (vault.classic.magicauth.io), from Node 20+ or
Cloudflare Workers, with no runtime dependencies.
It replaces @whi/magicauth-sdk 0.2.x. Two entry points:
| Entry point | What it is |
|---|---|
| @magicauth/classic-sdk/legacy | The @whi/magicauth-sdk surface, so a product switches vaults by changing its import and base URL |
| @magicauth/classic-sdk | The full client for every vault route (not yet designed) |
The design decisions are on magicauth-io/classic-planning#5.
Switching from @whi/magicauth-sdk
import { Collection, config } from '@magicauth/classic-sdk/legacy';
config.API_BASE_URL = 'https://vault.classic.magicauth.io';
const magicauth = new Collection(collectionId, accessKey);Every call keeps its signature. The steps for each environment, what behaves differently, and what each product changes are in the migration guide.
Development
# Install dependencies
npm install
# Unit tests and the Workers smoke test
npm test
# Typecheck and format check (what pre-push runs)
npm run checkSee CONTRIBUTING.md for the test layout, branches and releases.
