> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Server-side JS SDK

> The Hop server-side JS SDK allows you to interact with all Hop products on the server side.

Currently, the SDK is compatible with [Bun](https://bun.sh/),
[Node.js](https://nodejs.org/en/) and [Deno](https://deno.land/).

## Installing

```bash theme={null}
# NPM
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 jspm.dev. This will ensure dependencies
are bundled and cached for you.

```bash theme={null}
import {Hop} from 'https://jspm.dev/@onehop/js@<version>';
```

## Creating an SDK Instance

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

```js JS theme={null}
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,
});
```
