Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @upvest/tenancy-api with all npm packages installed. Try it out:

var tenancyApi = require("@upvest/tenancy-api")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@upvest/tenancy-api v0.0.18

An axios-based client for the Upvest Tenancy API

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

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free