Installation
Describes @stxapp/stx-typescript 0.12.1, the current release.
npm install @stxapp/stx-typescriptpnpm add @stxapp/stx-typescriptyarn add @stxapp/stx-typescriptbun add @stxapp/stx-typescriptRequires Node 18 or newer (or Bun). API-key signing uses Node’s crypto module, so run the client on a server, not in a browser.
Importing
Section titled “Importing”import { STX } from "@stxapp/stx-typescript";CommonJS works too:
const { STX } = require("@stxapp/stx-typescript");Check the install
Section titled “Check the install”node -e 'import("@stxapp/stx-typescript").then((m) => console.log(m.VERSION))'Run an example
Section titled “Run an example”The examples in this guide are ES modules that use top-level await. Save one as quickstart.mjs and run it with Node:
node quickstart.mjsTo use .js files instead, add "type": "module" to your package.json (npm pkg set type=module). For TypeScript, name the file quickstart.mts and run it with tsx: npx tsx quickstart.mts.
Pin an exact version in production. Before 1.0.0, a minor release can change the API.
Docs version v1.10.5

