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.js client for api.begin.com

  • 1.4.2
  • 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 token by creating a client at https://api.begin.com.

Install

npm i @begin/api

Usage

ESM

import { App } from '@begin/api'

CJS

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

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, zip })

// create a new app using @begin/chunker
let app = await App.create({ access_token, chunk, 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({ zip })

// deploy a new version of the app using @begin/chunker
await app.deploy({ chunk, 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' })

Contributing

Create .env with the following values:

BEGIN_CLIENT_ID=xxx
ACCESS_TOKEN=xxx

Keywords

FAQs

Package last updated on 21 Sep 2022

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