Socket
Book a DemoInstallSign in
Socket

@trufflehq/mothertree-client

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trufflehq/mothertree-client

The official client library for Truffle's Mothertree API.

0.1.0-alpha.15
latest
npmnpm
Version published
Maintainers
4
Created
Source

@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()

FAQs

Package last updated on 25 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.