Integration Guide

SDK Integration Verification

Check that your integration can reach Tork and authenticate, and receive a verification certificate to display on your projects.

Overview

This page covers server-reachable integrations

Verification is a live round-trip to the Tork API, so it applies to @torknetwork/sdk and to direct REST integrations — anything recorded as capture_mode=cloud attested_by=tork.

It does not apply to the on-device package tork-governance. That package makes its decisions locally and, with no API key, makes no network calls at all — there is no connection for a connectivity or authentication test to exercise.

Running verification confirms that:

API Connectivity
Your SDK can reach the Tork API
Authentication
Your API key is valid and active
PII Detection
The PII redaction system works correctly
Policy Evaluation
Your policies are loaded and evaluated
Rate Limiting
Rate limits are properly configured
Webhooks (Optional)
Webhook delivery is working

Quick Start

Verification is a call to the /v1/health/integration endpoint with your API key. Any HTTP client can make it — see the API Reference below for the language-independent form.

🌐

Any language (cURL)

Terminal
curl -X POST https://tork.network/api/v1/health/integration \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sdk_type": "rest",
    "tests_to_run": ["api_connectivity", "authentication", "pii_detection"]
  }'
📦

JavaScript / TypeScript (@torknetwork/sdk)

Terminal
# Install the cloud SDK — this is the package that talks to Tork
npm install @torknetwork/sdk

# Verify from Node
const res = await fetch('https://tork.network/api/v1/health/integration', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.TORK_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    sdk_type: 'node',
    tests_to_run: ['api_connectivity', 'authentication', 'pii_detection'],
  }),
});

const result = await res.json();
console.log(`Score: ${result.score}/100 - Grade: ${result.grade}`);
console.log(`Certificate: ${result.certificate_url}`);

API Reference

You can also call the verification API directly:

HTTP Request
POST https://tork.network/api/v1/health/integration
Authorization: Bearer your-api-key
Content-Type: application/json

{
  "sdk_type": "rest",
  "sdk_version": "2.0.0",
  "tests_to_run": ["api_connectivity", "authentication", "pii_detection"],
  "webhook_url": "https://your-app.com/webhook" // optional
}
Response
{
  "status": "pass",
  "score": 95,
  "grade": "A",
  "sdk": {
    "type": "rest",
    "version": "2.0.0"
  },
  "tests": {
    "api_connectivity": { "status": "pass", "latency_ms": 42 },
    "authentication": { "status": "pass", "key_type": "production" },
    "pii_detection": { "status": "pass", "detected": ["email", "phone"] },
    "policy_evaluation": { "status": "pass", "policies_loaded": 5 },
    "rate_limiting": { "status": "pass", "limit": 1000, "remaining": 998 }
  },
  "timestamp": "2026-01-25T10:30:00Z",
  "verification_id": "ver_abc123xyz",
  "certificate_url": "https://tork.network/verify/ver_abc123xyz"
}

Scoring & Grades

Your verification score is calculated based on the tests you run:

TestWeightDescription
API Connectivity20%Basic API reachability test
Authentication25%API key validation
PII Detection20%Test PII redaction functionality
Policy Evaluation20%Policy engine functionality
Rate Limiting10%Rate limit configuration
Webhook Delivery5%Optional webhook test
A+
97+
A
90+
B
80+
C
70+
D
60+
F
0+

Display Your Badge

If your score is 80 or higher, you'll receive a verification badge URL that you can display in your README or documentation:

What the badge attests

The badge attests that, at the timestamp shown, a live round-trip from your integration to Tork passed the tests above. It is a statement about connectivity, authentication and configuration — not a warranty that your application is correctly governed, and not a claim about any decision made outside that round-trip. A decision made on-device and reported as a client attestation (capture_mode=edge attested_by=client) is checked only for structural and fingerprint consistency; Tork did not execute that decision and cannot independently confirm its content.

Tork VerifiedA
Markdown
[![Tork Verified](https://tork.network/api/badge/your-verification-id)](https://tork.network/verify/your-verification-id)

Enterprise Features

Take advantage of our production-grade verification tools:

Ready to Verify?

Call the verification endpoint with your API key to test your integration and get your certificate.