1.0.0 • Published 4 years ago

@panviva/sdk v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Panviva.Sdk

Introduction

Wouldn't it be great if you could share information seamlessly? This JavaScipt sdk allows you to push your knowledge further and consume a complete list of Panviva's API offerings within your application. This is a simple NPM package provided by Panviva Pty. Ltd. to help streamline integrations with Panviva APIs within JavaScript environments.

Prerequisites

Setting up .Net Core project

To use the Panviva sdk, you must have:

  1. Access to a Panviva instance (also known as a tenant)
  2. A developer account on the Panviva developer portal (dev.panviva.com)
  3. An active Panviva API subscription (also known as an API plan) and valid Panviva API credentials

Setup For PanvivaClient in a NodeJs environment

Setting up .Net Core project

  1. Install the panviva.sdk package into node_modules and save it as a dependency in the package.json.

    • Run this command from the command-line in the same folder as your package.json:
        npm install --save panviva.sdk
  2. Import the Panviva client and the ResourceApiKeys enum from panviva.sdk into the file you wish to use it in.

    • Example:
     const { PanvivaClient, ResourceApiKeys } = require('testpanviva');
  3. Instantiate new PanvivaClient

    • To create a new client:
      var panvivaClient = new PanvivaClient("_Your instance name here_", "https://api.panviva.com");

    Note : Base Url is optional by default it will be https://api.panviva.com. You can provide a value to override the default.

  4. Set the subscription key

    • panvivaClient.setApiKey(ResourceApiKeys.apiKeyHeader, "replace with subscription key");
  5. Now you can make a request to the PanvivaApis if you have entered everything above correctly

    • An example of searching artefacts is:
      panvivaClient.searchArtefacts("_your instance name here_", "_your query_").then((response) => {
          console.log(response.body); 
      })
      .error((error) => console.log(error)).catch((ex) => console.log(ex));

Available PanvivaClient methods