Skip to main content
Production·api-gateway v2.4.1

CLI & SDK

Install the SDK, explore code examples, and use the CLI.

Installation

npmnpm install @forge/sdk
pnpmpnpm add @forge/sdk
yarnyarn add @forge/sdk

CLI Quick Reference

forge init my-projectScaffold a new project
forge deployDeploy to production
forge logs --followStream real-time logs
forge keys create --scope read,writeCreate an API key
forge webhooks listList webhook endpoints
forge statusCheck platform status

Your API key

FORGE_API_KEY=nxs_prod_****7f3a

Set as an environment variable. Never commit to source control.

SDK Examples

import { Forge } from "@forge/sdk";

const forge = new Forge({
  apiKey: process.env.FORGE_API_KEY!,
});

// Create a webhook endpoint
const webhook = await forge.webhooks.create({
  url: "https://example.com/hook",
  events: ["user.created", "invoice.paid"],
});

console.log(webhook.id); // whk_a1b2c3