Skip to main content
Use this quickstart when you are building a TypeScript app or service with Shodai Agreements. You will authenticate with the Agreements API, validate a complete agreement JSON artifact, preflight deployment values, and sign the deploy permit locally without creating a live agreement. For the agent/MCP path, use Quickstart with MCP. To compare the two first-run paths, start with Choose an integration surface. If you are building an installed Node.js CLI or desktop-style client in which a Shodai user signs in, use Connect an installed TypeScript client with delegated OAuth. The API-key flow below remains the shortest path for other TypeScript integrations.
This quickstart stops before deployWithPermit(...). The final signing step proves that your app can reach API auth, validation, deployment preflight, chain/RPC context, and EIP-712 signing without performing a live write.

Prerequisites

  • Node.js >=18.
  • A Shodai testnet API key. Create one in the Developer Portal.
  • A Linea Sepolia RPC URL for chainId: 59141.
  • A local package or temporary directory where you can install npm packages.

Make the first-flight script

1

Create an ESM project

2

Install the SDK and signing dependencies

The API client handles typed Agreements API calls. viem provides the test wallet, public client, and EIP-712 signing primitives used by the SDK signing helpers.
3

Set environment variables

RPC_URL must point at Linea Sepolia because this quickstart uses chainId: 59141.
4

Save the example agreement

Copy the complete simple-agreement.json code block from Simple Agreement into:
Use the complete JSON artifact from the example page, not an abbreviated API request body.
5

Create the quickstart script

Create quickstart.ts:
6

Run the script

The generated Party A wallet signs the deploy permit. The generated wallets are for this local test only; do not persist generated private keys or use this pattern for production custody.

Completion state

You have completed this quickstart when the script prints:
  • a healthy API response
  • an authenticated agreement list response
  • template validation output for the Simple Agreement
  • deployment preflight output
  • signatureV, signatureR, and signatureS from signDeployWithPermit(...)
At that point your TypeScript integration has reached API auth, agreement validation, deployment preflight, chain/RPC context, and EIP-712 signing readiness. It has not deployed an agreement.

Continue from here

Run an end-to-end agreement workflow

Continue from first-flight readiness to deployment, signed input submission, state reads, and input history.

TypeScript client reference

Reference constructor options, methods, signing helpers, diagnostics, path helpers, and exports.

Author agreement JSON

Model terms, variables, participants, states, inputs, issuers, and transitions.

Deploy an agreement

Learn the live deployment workflow after preflight and signing readiness are working.