@faable/auth-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Faable Auth SDK Client

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.

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=demo@example.com
const users = await api.listUsers({ email: "demo@example.com" }).first();

Readme

Keywords

none

Package Sidebar

Install

npm i @faable/auth-sdk

Weekly Downloads

18

Version

1.1.3

License

MIT

Unpacked Size

87.1 kB

Total Files

15

Last publish

Collaborators

  • boyander