This workspace owns the TypeScript SDK used to read and write Verax data from backends, frontends, scripts, and demo apps.
This README is maintainer-oriented. For end-user integration guidance, see the published docs at docs.ver.ax.
From the monorepo root:
pnpm installInside sdk/, copy the example env file when you want to run examples or integration tests:
cp .env.example .envPRIVATE_KEY is used by example scripts and integration tests. THE_GRAPH_API_KEY is optional and helps when you want
to test against The Graph gateway instead of the public Studio endpoints.
Run these commands from sdk/.
| Command | Purpose |
|---|---|
pnpm run build |
Regenerate the Graph client and build the package |
pnpm run generate |
Regenerate the Graph client only |
pnpm run test:unit |
Run unit tests |
pnpm run test:integration |
Run integration tests |
pnpm run test:ci |
Copy .env.example to .env and run the default test suite |
pnpm run test:integration:ci |
Copy .env.example to .env and run integration tests |
pnpm run schema / module / portal / attestation |
Run contributor example scripts under examples/ |
pnpm run publish:public |
Publish the package to npm |
The built-in default configs currently live in:
src/VeraxSdk.tssrc/types/index.tsforChainNamesrc/utils/urlResolver.tsfor multi-chain fallback URLs
When you add or update a supported network, keep all three in sync. In particular:
- add the backend and frontend defaults in
src/VeraxSdk.ts - add or update the matching
ChainNameentry insrc/types/index.ts - update
src/utils/urlResolver.tsso fallback URLs match the published deployment - update tests and any example scripts affected by the change
- update the root
README.mdmatrix if public endpoints or addresses changed
The root README and the SDK defaults should reflect the same public deployments.
The SDK supports subgraphUrlOverrides for contributors or operators who want to test against custom gateway or Studio
endpoints.
Example:
import { ChainName, VeraxSdk } from "@verax-attestation-registry/verax-sdk";
const sdk = new VeraxSdk({
...VeraxSdk.DEFAULT_LINEA_MAINNET,
subgraphUrlOverrides: {
[ChainName.LINEA_MAINNET]: "https://gateway.thegraph.com/api/YOUR_API_KEY/subgraphs/id/...",
[ChainName.ARBITRUM_MAINNET]: "https://gateway.thegraph.com/api/YOUR_API_KEY/subgraphs/id/...",
},
});For contributors, the important part is that single-chain defaults, multi-chain fallbacks, and the published README matrix all stay aligned when deployments change.
The package includes contributor utilities under examples/ and a command reference in
doc/cli-examples.md.
Those commands are useful for smoke testing SDK flows during development, but they are not a separately versioned public CLI product.
The published package is
@verax-attestation-registry/verax-sdk.
Before publishing:
- run the relevant tests
- confirm generated artifacts are up to date
- bump the package version in
package.json - publish with:
pnpm run publish:publicWhen a new Verax deployment is added:
- update
src/VeraxSdk.ts - update
src/types/index.ts - update
src/utils/urlResolver.ts - confirm explorer/demo apps still compile against the new SDK version
- update the root
README.mdpublic matrix