Socket
Book a DemoInstallSign in
Socket

@suborbital/se2

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@suborbital/se2

SDK for interacting with the Suborbital Extension Engine

latest
Source
npmnpm
Version
0.5.0-beta.4
Version published
Maintainers
2
Created
Source

Suborbital

Suborbital Extension Engine (SE2) JavaScript SDK

This SDK provides an easy way to interact with the SE2 API from JavaScript or TypeScript.

Installation

Install via yarn:

yarn add @suborbital/compute

or npm:

npm install @suborbital/compute

Usage

Start by instantiating the client with your environment token:

import { Suborbital } from "@suborbital/compute";

const suborbital = new Suborbital(process.env.SE2_ENV_TOKEN);

The URIs for each of the APIs can be configured, if different than the defaults:

import { Suborbital } from "@suborbital/compute";

const config = {
  adminUri: "https://acme.co:8081",
  execUri: "https://acme.co:8080",
  builderUri: "https://acme.co/builder",
};

const suborbital = new Suborbital(process.env.SE2_ENV_TOKEN, config);

A configuration for a locally-deployed Suborbital Extension Engine is also available:

import { Suborbital, localUriConfig } from "@suborbital/compute";

const suborbital = new Suborbital(process.env.SE2_ENV_TOKEN, localUriConfig);

Then access endpoints on their respective sub-clients:

async function run() {
  const result = await suborbital.exec.run(
    {
      environment: "com.acmeco",
      userId: "1234",
      namespace: "default",
      name: "hello",
    },
    "world!"
  );

  console.log("Output:", result);
}

FAQs

Package last updated on 12 Apr 2023

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