npm

Need private packages and team management tools?Check out npm Orgs. »

@upvest/tenancy-api

0.0.18 • Public • Published

Client library for the Upvest Tenancy API

This API encompasses operations for managing users within your tenancy.

A tenancy is your "area" of Upvest, where you will be registering your users before authenticating them with OAuth2. When registering a user, you will be provided with a recovery kit to forward on to the user.

This API client is based on axios.

Here is an example how to use it in Node.js:

const { UpvestTenancyAPI } = require('@upvest/tenancy-api');
 
const config = {
  "baseURL": "https://api-playground.eu.upvest.co/1.0/",
  "apikey": {
    "key": "tPKWL9B_yTgfSToOFJmLyg",
    "secret": "9O7tLb1ub6qLHZQ00ButDOcfvw9g7Gn8GzFB4WmsUrA",
    "passphrase": "dlKsARh6U3chEQK0WBTU-u-qqn-l4IknmXH1jRGW_fQ"
  }
}
 
const tenancy = new UpvestTenancyAPI(
  config.baseURL,
  config.apikey.key,
  config.apikey.secret,
  config.apikey.passphrase
);
 
async function example() {
  const username = 'Example User';
  const password = 'ex@mp1e p@55w0rd';
 
  let exampleUser;
  try {
    exampleUser = await tenancy.users.create(username, password);
  }
  catch (error) {
    // Handle error
  }
 
  console.log(exampleUser.username);
 
  for await (const user of tenancy.users.list()) {
    console.log(user.username);
  }
}
 
example();
 

For more examples, please check out our test-suite at https://www.npmjs.com/package/@upvest/api-tests

License

This software is released under the MIT License

install

npm i @upvest/tenancy-api

Downloadsweekly downloads

95

version

0.0.18

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability