New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@oxide/api

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oxide/api

TypeScript client for the Oxide API

Source
npmnpm
Version
0.1.0-alpha.7
Version published
Weekly downloads
11
-31.25%
Maintainers
4
Weekly downloads
 
Created
Source

Oxide TypeScript SDK

Usage

Installation

npm install @oxide/api

Getting an API token

The easiest way to get a device token is to use the CLI.

oxide auth login --host https://my-oxide-rack.com

Then print the token:

oxide auth status --show-token

In the following example it's passed to the script through the OXIDE_TOKEN environment variable on the assumption that you don't want to hard-code a token into a script, but this can of course be done however you want. OXIDE_TOKEN is not a special variable for the TypeScript SDK (it is for the CLI).

Example

import Oxide from "@oxide/api"

const oxide = new Oxide({
  host: "https://my-oxide-rack.com",
  token: process.env.OXIDE_TOKEN,
})

const result = await oxide.methods.projectList({})

if (result.type === "success") {
  console.log(result.data.items.map((p) => p.name))
}

How does it all work?

Methods

Request bodies

Responses: ApiResult<T>

Keywords

oxide

FAQs

Package last updated on 08 May 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