The official Upsun SDK for Node.js on TypeScript. This SDK provides a Node.js interface that maps to the Upsun CLI commands.
For more information, read the documentation.
CAUTION: This project is currently in Beta, meaning features and APIs may evolve over time.
Please report bugs or request new features by creating a GitHub issue.
Install the SDK via npm:
npm install upsun-sdk-nodeYou will need an Upsun API token to use this SDK.
Store it securely, preferably in an environment variable.
import { UpsunClient, UpsunConfig } from 'upsun-sdk-node';
const config: UpsunConfig = {
apiKey: process.env.UPSUN_CLI_TOKEN || '',
};
const upsunClient = new UpsunClient(config);const organizations = await upsunClient.organizations.list();const projects = await upsunClient.projects.list('<organizationId>');const result = await upsunClient.environments.redeploy('<projectId>', '<environmentId>');Clone the repository and install dependencies:
git clone git@github.com:upsun/upsun-sdk-node.git
npm installThe SDK is built as follows:
- From the JSON specs of our API
- Using
@openapitools/openapi-generator-cli - Which generates a low-level API client
- On top of that, the SDK exposes higher-level task-oriented methods
API classes are generated from the Upsun OpenAPI spec.
npm run spec:generate:install
npm run spec:fullContributions are welcome!
Please open a pull request or an issue
for any improvements, bug fixes, or new features.
To run the tests, use:
npm run testThis project is licensed under the Apache License 2.0. See the LICENSE and NOTICE files for details.