Production·api-gateway v2.4.1
CLI & SDK
Install the SDK, explore code examples, and use the CLI.
Installation
npm
npm install @forge/sdkpnpm
pnpm add @forge/sdkyarn
yarn add @forge/sdkCLI Quick Reference
forge init my-projectScaffold a new projectforge deployDeploy to productionforge logs --followStream real-time logsforge keys create --scope read,writeCreate an API keyforge webhooks listList webhook endpointsforge statusCheck platform statusYour API key
FORGE_API_KEY=nxs_prod_****7f3aSet 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