https://github.com/usedatabrew/fly-machines-sdk
JS/TS SDK for Fly.io - Allows you to create and manage applications by API
https://github.com/usedatabrew/fly-machines-sdk
databrew devops devtools flyio
Last synced: 6 months ago
JSON representation
JS/TS SDK for Fly.io - Allows you to create and manage applications by API
- Host: GitHub
- URL: https://github.com/usedatabrew/fly-machines-sdk
- Owner: usedatabrew
- License: mit
- Created: 2023-10-21T21:42:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-21T17:15:54.000Z (almost 2 years ago)
- Last Synced: 2025-10-29T01:09:14.314Z (8 months ago)
- Topics: databrew, devops, devtools, flyio
- Language: TypeScript
- Homepage: https://fly.io
- Size: 695 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
## Fly.IO Machines SDK for Node.JS

### Install package
```shell
npm i fly-machines-sdk
```
### Init SDK
Get Fly.io API Token
```shell
export FLY_TOKEN=$(fly auth token)
```
```ts
import { FlyMachinesSDK } from 'fly-machines-sdk';
const apiKey = process.env.FLY_TOKEN;
const orgSlug = 'personal';
const sdk = new FlyMachinesSDK(apikey, orgSlug);
```
### Create new application
Since fly.io migrated to app v2 each application should have a machine
But two requests will be executed.
1. Create application
2. Assign machine with the application
```ts
await sdk.createApplicationOnMachine({ name: 'app_name', config: {} });
```