Skip to content
  • SDKs
  • Server Side
  • JavaScript

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, 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 myToken = 'ptk_xxx';
// Export the Hop SDK instance so you can use it throughout your codebase
export const hop = new Hop(myToken);
// Example: Creating a project secret
await hop.projects.secrets.create(
    Math.floor(Math.random() \* 100).toString(),
Last updated on September 21, 2022