Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@begin/api

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@begin/api

Node client for api.begin.com

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by287.5%
Maintainers
4
Weekly downloads
 
Created
Source

Node client for api.begin.com

Obtain an access_token by creating a client at https://api.begin.com.

Install

npm i @begin/api

ESM

import { App } from '@begin/api'

CJS

const { App } = require('@begin/api')

Usage

App static methods

// list apps
let { apps } = await App.list()

// find an app by id
let app = await App.find({ access_token, appID })

// create a new app 
let app = await App.create({ access_token, name, zip })

App instance methods

// read app logs
let logs = await app.logs()

// read build logs
let logs = await app.builds()

// deploy a new version of the app
await app.deploy({ name, zip })

// destroy an app
await app.destroy()

Work with environment variables

// get the app env
let { env } = await app.env.get()

// write an env var
await app.env.set({ key: "HENLO", value: "world" })

// remove an env var
await app.env.destroy({ key: "HENLO" })

Work with static assets

// get the app env
let { files } = await app.static.get()

// write a file
let body = Buffer.from('console.log("hi")').toString('base64')
await app.static.set({ name: '/file.js', body  })

// remove the file
await app.static.destroy({ name: '/file.js' })

Keywords

FAQs

Package last updated on 20 Oct 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc