Faable Auth management and auth API Client
Programmatically perform FaableAuth administrative tasks though our REST API.
⚠️ Use this library in server side only. Otherwise administrative credentials may be exposed.
npm install @faable/auth-sdk
import { FaableAuthApi } from "@faable/auth-sdk";
import { createClientCredentials } from "@faable/sdk-base";
const auth = createClientCredentials();
const api = FaableAuthApi.create({
auth,
team: "<faable_team_id>",
});
Get user:
const user = await api.getUser("<user_id>");
Update user:
const updated_user = await api.updateUser("<user_id>", {
phone: "+34XXXXXXXXX",
});
List users:
// Returns first page of latest 30 users
const users = await api.listUsers().first();
// Query users with email=demo@example.com
const users = await api.listUsers({ email: "demo@example.com" }).first();