Socket
Book a DemoInstallSign in
Socket

curtain-web-api

Package Overview
Dependencies
Maintainers
0
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curtain-web-api

---

latest
npmnpm
Version
1.0.60
Version published
Maintainers
0
Created
Source

Curtain Web API

This is a node.js package used to interact with the Curtain Web REST API.

Installation

npm install curtain-web-api pouchdb -s
npm install @types/pouchdb -D

Usage

import { CurtainWebApi } from 'curtain-web-api';

const curtainAPI = new CurtainWebApi("https://curtain-api-location/")


// Login to the API 

curtainAPI.login("username", "password").then((result) => {
    console.log(result);
    // The result is an object containing the user's information
}).catch((error) => {
    console.log(error);
});

// Get the user's information
curtainAPI.getUser().then((result) => {
    console.log(result);
    // The result is an object containing the user's information similar to the login but can only be performed after login have succeeded
}).catch((error) => {
    console.log(error);
});

// Get session information
curtainAPI.getSessionSettings(sessionId).then((result) => {
    console.log(result);
    // The result is an object containing the session's basic information without any data
}).catch((error) => {
    console.log(error);
});


// Get session data
curtainAPI.postSettings(sessionId, sessionToken).then((result) => {
    console.log(result);
    // The result is an object containing the session's data
}).catch((error) => {
    console.log(error);
});


// Upload session data
curtainAPI.putSettings(settings, enableToPublic, description, sessionType).then((result) => {
    console.log(result);
    // The result is an object containing the session's data
}).catch((error) => {
    console.log(error);
});

FAQs

Package last updated on 13 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts