0.0.3 • Published 12 months ago
@tenancy.tly/sdk v0.0.3
Tenancy - SDK for server-side Node.js apps over gRPC.
The Tenancy SDK for Node.js enables developers to easily work with Tenancy's APIs and build server-side applications that run on Node.js.
Installation
yarn add @tenancy.tly/sdk
Usage
import * as Tenancy from '@tenancy.tly/sdk'
const tenancy = new Tenancy.SDK({ address: 'localhost:50051' })
/**
* The current user's access token, provided by your OIDC.
*/
tenancy.setAuth('Bearer __TOKEN__')
const { data: org } = await tenancy.Organizations.create({
name: 'Community Hospital Theana',
subdomain: 'theana',
/**
* Add additional attributes based on your context.
*/
attributes: [
{
key: 'stripeId',
value: 'cust_1H9Z1nJZ6Xa0QX2',
},
{
key: 'logo',
value: 'https://turnly.app/assets/logo.png',
},
],
})