@kevinmichaelchen/distilled-auth0
v0.3.0
Published
Protocol-based Effect 4 SDK for the Auth0 Management API v2
Readme
distilled-auth0
An Effect 4-native Auth0 Management API v2 SDK generated from Auth0's official OpenAPI 3.1 document. Operations use Distilled's trait-driven protocol runtime and are grouped into service modules.
Set AUTH0_DOMAIN (for example tenant.us.auth0.com) and
AUTH0_MANAGEMENT_TOKEN. The client constructs the tenant-specific /api/v2
base URL and sends the token as a bearer credential.
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
import { CredentialsFromEnv } from "@kevinmichaelchen/distilled-auth0";
import { getClients } from "@kevinmichaelchen/distilled-auth0/clients";
const Auth0Live = Layer.mergeAll(FetchHttpClient.layer, CredentialsFromEnv);
await Effect.runPromise(Effect.provide(getClients({}), Auth0Live));