Environment & E2E
The SDK doesn’t read process.env directly — every knob is an
explicit field on createPact(). The names below are a convention we
use across the CLI, the dashboard, and our deploy templates, so you
can pipe one set of env vars through to all of them.
If you want a different prefix in your own app, that’s fine. The mapping is what matters.
Variables
Section titled “Variables”| Env var | Maps to | Default | When you need it |
|---|---|---|---|
SOLANA_RPC_URL | createPact({ rpcUrl }) | Public mainnet-beta / devnet RPC, or 127.0.0.1:8899 for localnet | Public RPC rate limits, or you run a private cluster. |
PACT_PROXY_BASE_URL | createPact({ proxyBaseUrl }) | https://market.pactnetwork.io | You run your own Pact Market proxy, or are pointing at a Railway preview. |
PACT_INDEXER_BASE_URL | createPact({ indexerBaseUrl }) | https://indexer.pactnetwork.io | Same as above for the indexer (refund/billed event source — best-effort). |
PACT_PROGRAM_ID | createPact({ programId }) | mainnet only; required on devnet/localnet (B1) | Devnet, localnet, or any time you pin a specific deploy. See Contract addresses. |
PACT_INDEXER_SIGNING_KEY | createPact({ webhook: { indexerSigningKey } }) | None | You want the optional webhook receiver instead of polling the indexer. |
Minimal .env for live E2E
Section titled “Minimal .env for live E2E”If you want to point at our live infra exactly the way our own deploys do:
SOLANA_RPC_URL=https://api.mainnet-beta.solana.comPACT_PROXY_BASE_URL=https://market.pactnetwork.ioPACT_INDEXER_BASE_URL=https://indexer.pactnetwork.io# Omit PACT_PROGRAM_ID on mainnet — the SDK has the right default.# Omit PACT_INDEXER_SIGNING_KEY unless you wire up the webhook path.For devnet/localnet, you must set PACT_PROGRAM_ID — see the
B1 callout.
Wiring it into your code
Section titled “Wiring it into your code”The SDK itself stays explicit. You read the env vars in your own bootstrap and pass them in:
import { createPact } from "@q3labs/pact-sdk";
const pact = await createPact({ network: "mainnet", signer: /* ... */, rpcUrl: process.env.SOLANA_RPC_URL, proxyBaseUrl: process.env.PACT_PROXY_BASE_URL, indexerBaseUrl: process.env.PACT_INDEXER_BASE_URL, programId: process.env.PACT_PROGRAM_ID,});Anything you don’t pass falls back to the mainnet default.
Where to get help
Section titled “Where to get help”- GitHub issues: github.com/pactnetwork/pact-monitor/issues
- Email: rick@quantum3labs.com
- Telegram: t.me/metalboyrick