Currently, the SDK is compatible with Bun, Node.js and Deno.


npm i @onehop/js

# Or with Yarn
yarn add @onehop/js

# Or with Bun
bun add @onehop/js

Or in Deno, we recommend serving from This will ensure dependencies are bundled and cached for you.

import {Hop} from '<version>';

Creating an SDK Instance

To use the SDK, you must first create a project token. You can also use a PAT (personal access token), however this is not recommended as it has access to all of your projects.

import {Hop} from '@onehop/js';

const token = 'ptk_xxx';

// Export the Hop SDK instance so you can use it throughout your codebase
export const hop = new Hop(token);

// Example: Creating a deployment
await hop.ignite.deployments.create({
	name: 'postgres',
	container_strategy: 'manual',
	type: RuntimeType.EPHEMERAL,
	version: '12-12-2022',
	image: {
		name: 'postgres',
		auth: null,
		gh_repo: null,
	env: {
		POSTGRES_PASSWORD: 'password',
		POSTGRES_USER: 'postgres',
		POSTGRES_DB: 'postgres',
	resources: {
		vcpu: 0.5,
		ram: '128MB',
		vgpu: [],
	restart_policy: RestartPolicy.NEVER,