1. Install the SDK
2. Supply the API key
Keep the key in your server-side secret manager. These examples read the environment in application code and pass the value to the SDK. The SDK does not read environment variables itself, persist credentials, or send them anywhere except the Apostra API.APOSTRA_ACCOUNT_ID is optional when the credential already resolves to one
account. If you set it, it must name an account that credential can reach.
3. Verify the account
CallgetStatus before a write. It returns the account resolved by the
credential, its readiness and any blockers.
4. Preview, then confirm a launch
Use a new idempotency key for each distinct write. Keep the same key only when retrying the exact same request after its result is uncertain. A launch request withoutconfirmLaunch previews the draft campaign. Inspect that response and
only then make a separate confirmed request.
confirmLaunch: true can activate the campaign’s staged media buys. Do not put
the confirmation call on an automatic retry path. The current SDK makes zero
automatic retries and sends the key you supply unchanged.
5. Read delivery
UsegetDelivery with the campaign and a reporting window. The result is a
page, not a fixed snapshot: preserve the same query when following a cursor.
examples/first-value.ts
and examples/first_value.py. They make the launch confirmation opt-in with
APOSTRA_CONFIRM_LAUNCH=true so the default synthetic-seller run stops after
the preview. For transport error and retry behaviour, use the current
SDK guide; future transport improvements do not change this flow.