Quickstart
Get from zero to your first API call in under 5 minutes using the twak CLI.
Step 1 — Install the CLI
Run directly without installing (recommended):
npx @trustwallet/cli --versionOr install globally:
npm install -g @trustwallet/cli
twak --versionPermission denied? If you get
EACCESon macOS/Linux, either usenpx @trustwallet/cli(no install needed), install Node via nvm (avoids/usr/localpermissions), or runsudo npm install -g @trustwallet/cli.
Step 2 — Configure credentials
Get your API key and HMAC secret from the developer portal, then run:
twak init --api-key your_access_id \
--api-secret your_hmac_secretCredentials are stored in ~/.twak/credentials.json (file permissions 0600). This is the recommended approach for local development.
For CI/CD pipelines, use environment variables instead:
export TWAK_ACCESS_ID=your_access_id
export TWAK_HMAC_SECRET=your_hmac_secretDo not add these exports to
~/.zshrcor~/.bashrc. Usetwak initfor persistent local credentials — it stores them in a dedicated file with restricted permissions. Env vars are intended for ephemeral CI/CD environments.
Confirm the setup:
Never commit your HMAC secret to version control. If using a
.envfile, add it to.gitignore.
Step 3 — Make your first request
Fetch the current ETH price — no wallet required:
Add --json for machine-readable output:
List all supported chains:
Step 4 — Explore more commands
Run any command with --help to see all options.
Next steps
CLI Reference — full command reference
Authentication — how HMAC signing works
Last updated
Was this helpful?