@dabblelab/mantium

1.0.0-alpha.1 • Public • Published

Mantium NodeJS SDK

This is a NodeJS SDK for the Mantium API.

Installation

npm install @dabblelab/mantium

Usage

  1. Require the SDK:
const mantium = require('@dabblelab/mantium');
  1. Create a new client:
const client = new mantium(process.env['MANTIUM_USERNAME'], process.env['MANTIUM_PASSWORD']);

Note: The example above assumes the environment variables MANTIUM_USERNAME and MANTIUM_PASSWORD are set.

  1. Set the client's authorization token:
client.token = await client.getToken();
  1. Use the client:
const promptId = "b44bc7de-ab0d-441e-9b8a-f0ddc98e1dfe"; // from mantium dashboard
const text = `In today’s world, technology changes fast, and unless you’re mindful, 
it’s easy to fall behind. For much of the 20th century, hyper specialization was key.
Today however, you need to dabble in a lot of areas to keep up.`;

client.tryPrompt(promptId, text)
    .then(response => console.log(response));
    .catch(error => console.log(error));

Readme

Keywords

none

Package Sidebar

Install

npm i @dabblelab/mantium

Weekly Downloads

1

Version

1.0.0-alpha.1

License

ISC

Unpacked Size

4.15 kB

Total Files

3

Last publish

Collaborators

  • stevetingiris
  • khalid0807