Skip to content

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.

Env varMaps toDefaultWhen you need it
SOLANA_RPC_URLcreatePact({ rpcUrl })Public mainnet-beta / devnet RPC, or 127.0.0.1:8899 for localnetPublic RPC rate limits, or you run a private cluster.
PACT_PROXY_BASE_URLcreatePact({ proxyBaseUrl })https://market.pactnetwork.ioYou run your own Pact Market proxy, or are pointing at a Railway preview.
PACT_INDEXER_BASE_URLcreatePact({ indexerBaseUrl })https://indexer.pactnetwork.ioSame as above for the indexer (refund/billed event source — best-effort).
PACT_PROGRAM_IDcreatePact({ programId })mainnet only; required on devnet/localnet (B1)Devnet, localnet, or any time you pin a specific deploy. See Contract addresses.
PACT_INDEXER_SIGNING_KEYcreatePact({ webhook: { indexerSigningKey } })NoneYou want the optional webhook receiver instead of polling the indexer.

If you want to point at our live infra exactly the way our own deploys do:

Terminal window
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
PACT_PROXY_BASE_URL=https://market.pactnetwork.io
PACT_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.

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.