@faable/auth-sdk
v1.1.3
Published
<p align="center"> <a href="https://faable.com"> <h1 align="center">Faable Auth SDK Client</h1> </a> <p align="center">Faable Auth management and auth API Client</p> </p>
Downloads
92
Readme
Programmatically perform FaableAuth administrative tasks though our REST API.
⚠️ Use this library in server side only. Otherwise administrative credentials may be exposed.
Install
npm install @faable/auth-sdk
Config
import { FaableAuthApi } from "@faable/auth-sdk";
import { createClientCredentials } from "@faable/sdk-base";
const auth = createClientCredentials();
const api = FaableAuthApi.create({
auth,
team: "<faable_team_id>",
});
Usage
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 protected]
const users = await api.listUsers({ email: "[email protected]" }).first();