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.
JS
Copy
Ask AI
import {Hop} from '@onehop/js';const token = 'ptk_xxx';// Export the Hop SDK instance so you can use it throughout your codebaseexport const hop = new Hop(token);// Example: Creating a deploymentawait 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,});