Skip to main content

Quickstart

Prerequisites

  • Node.js 20 or newer. The SDK is server-only.
  • A Blank account with a username set and a verified wallet.
  • A scoped API key for the environment you are calling.

1. Install the SDK

Major version 3 is the client for API v2. Pin it explicitly: earlier majors targeted the removed legacy API and will not work against /api/v2. Version 3 ships typed resource modules, runtime response validation, bounded retries, durable idempotency keys, Problem Details errors, pagination helpers, transaction-intent submission, and webhook signature verification.

2. Create an API key

  1. Sign in at blank.build and open Settings.
  2. Set a username if the account does not have one.
  3. Create a key: name it, pick an expiry, and select only the scopes it needs. Scopes cannot be widened after creation.
  4. Copy the secret immediately. It is displayed once and never again.
Production keys start with blank_live_. Development and staging keys start with blank_test_. See Authentication for the full lifecycle.

3. Configure your server environment

Never ship an API key to a browser, a mobile app, or a public repository. The SDK throws if you construct a client with an apiKey in a browser runtime, and the API grants no browser CORS allowance to authenticated requests.

4. Create a client

The default origin is https://api.blank.build/api/v2. Override baseUrl only for a trusted staging or local Blank deployment; it must use HTTPS outside localhost. apiKey also accepts a function returning a string or Promise<string>, so you can pull the credential from a secret manager on each request.

5. Confirm the key

GET /me works with any valid key and returns nothing beyond the key’s own identity. It is the fastest way to check that a credential, environment, and scope set are what you expect.

6. Read public data

Token and market reads need no key at all:
The same call over raw HTTP:

7. Read the response metadata

Every SDK call returns { data, metadata, response }.
Log metadata.requestId alongside every failure. It is the identifier Blank needs to trace a request.

Next steps

Scopes

Exactly which scope each operation requires.

Conventions

Pagination, rate limits, retries, deadlines, and idempotency.

Price predictions

The main automation surface: eligibility, rounds, and submissions.

Webhooks

Signed CloudEvents instead of polling.