0.1.0-alpha.15 • Published 2 years ago
@trufflehq/mothertree-client v0.1.0-alpha.15
@trufflehq/mothertree-client
This is the official client for Truffle's Mothertree API. It can be used both on the server and in the browser.
Installation
npm install @trufflehq/mothertree-client
Basic usage
import { MothertreeClient } from "@trufflehq/mothertree-client";
const client = new MothertreeClient({
// pass in the user's access token if you have one;
// to ensure compatibility with the browser,
// this library does not verify the token,
// so if you're on the server, you should
// do this with a library like `jsonwebtoken`
accessToken: 'your-access-token',
// optional;
// defaults to 'https://mothertree.staging.bio/graphql'
url: 'https://mothertree.staging.bio/graphql'
});
// Get the current user's id
client.userId
// Get the current user's member id
client.orgMemberId
// Get the id of the org that the current user is interacting with
client.orgId
// Get the current user's member info
await client.getOrgMember()
// Get the current org's info
await client.getOrg()
// Get the current user's roles in the current org
await client.getRoles()
0.2.0-alpha.1
2 years ago
0.1.0-alpha.15
2 years ago
0.1.0-alpha.14
2 years ago
0.1.0-alpha.10
2 years ago
0.1.0-alpha.12
2 years ago
0.1.0-alpha.11
2 years ago
0.1.0-alpha.13
2 years ago
0.1.0-alpha.9
2 years ago
0.1.0-alpha.8
2 years ago
0.1.0-alpha.7
2 years ago
0.1.0-alpha.6
2 years ago
0.1.0-alpha.5
2 years ago
0.1.0-alpha.4
2 years ago
0.1.0-alpha.1
2 years ago
0.1.0-alpha.3
2 years ago
0.1.0-alpha.2
2 years ago
0.1.0-alpha.0
2 years ago