ConnectRPC is a set of libraries for building type-safe APIs with Protocol Buffers. It produces small, idiomatic clients that work over HTTP/1.1 and HTTP/2 — no special proxies or gRPC infrastructure required.
The Thirdfort Client API is defined using Protocol Buffers and can be consumed via ConnectRPC as an alternative to the REST/JSON interface described in our OpenAPI specification.
Download the proto definitions for the API version you want to use. Each bundle includes:
buf.yaml — dependency configuration for Bufbuf.gen.yaml — a ready-to-use code generation config for TypeScriptDownload thirdfort-protos-v1.zip
Download thirdfort-protos-v1alpha2.zip
The downloaded bundle includes a buf.gen.yaml that generates ConnectRPC TypeScript clients. Follow the steps below to generate and use the client.
You need Node.js (18+) and the Buf CLI:
# Install Buf CLI
npm install -g @bufbuild/buf
# Install runtime dependencies in your project
npm install @bufbuild/protobuf @connectrpc/connect @connectrpc/connect-web
Unzip the downloaded bundle and run code generation:
# Unzip the bundle
unzip thirdfort-protos-v1.zip -d thirdfort-protos
cd thirdfort-protos
# Install proto dependencies
buf dep update
# Generate TypeScript client code
npx buf generate
This creates a gen/ directory containing:
@bufbuild/protobuf)@connectrpc/connect)import { createClient } from "@connectrpc/connect";
import { createConnectTransport } from "@connectrpc/connect-web";
import { ClientService } from "./gen/thirdfort/client/v1/service_connect";
// Create a transport configured with your auth token
const transport = createConnectTransport({
baseUrl: "https://api.thirdfort.dev/client/api",
interceptors: [
(next) => async (req) => {
req.header.set("Authorization", `Bearer ${YOUR_ACCESS_TOKEN}`);
return next(req);
},
],
});
// Create a typed client
const client = createClient(ClientService, transport);
// Make API calls with full type safety
const check = await client.createCheck({
parent: "organizations/123/teams/456",
check: {
displayName: "Identity verification for John Doe",
template: "checkTemplates/identity-verification-check-v1-0-0",
params: {
"@type": "type.googleapis.com/thirdfort.client.checks.type.v1.IdentityVerificationCheckParams",
subject: {
givenName: "John",
familyName: "Doe",
},
},
},
});
console.log("Created check:", check.name);
@connectrpc/connect-node instead of @connectrpc/connect-web.