JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 47
  • Score
    100M100P100Q66705F
  • License ISC

API client for CapRover

Package Exports

  • caprover-api
  • caprover-api/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (caprover-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

CapRover API SDK (TypeScript)

A simple, typed TypeScript SDK for the CapRover API.

Install

npm install caprover-api

csharp Copy Edit

Usage

import CapRoverAPI, { CapRoverModels } from 'caprover-api'

const caprover = new CapRoverAPI(
    'https://captain.server.demo.caprover.com',
    () => {
        // get password and otp from user
        return Promise.resolve({
            password: 'captain42',
            otpToken: undefined, // only if 2FA is enabled
        })
    }
)

caprover
    .getAllNodes()
    .then((response) => {
        console.log(response)
    })
    .catch((error) => {
        console.log(error)
    })

How to Run Locally

  1. npm install
  2. npm run dev (after putting your own password/URL!)