Skip to main content

SDK Reference

What is the SDK Reference?

This section provides documentation for CVT's language-specific SDKs. Each SDK offers the same core functionality, allowing you to choose the one that best fits your application's technology stack.

SDK Architecture

For information about SDK design patterns, adapter architecture, and how SDKs maintain cross-language consistency, see SDK Architecture.

Published SDKs

CVT SDKs are published to public registries: Node.js to npmjs, Java to Maven Central, Python to PyPI, and Go via go get.

Available SDKs

LanguagePathStatus
Node.jssdks/nodeProduction-ready
Pythonsdks/pythonProduction-ready
Gosdks/goProduction-ready
Javasdks/javaProduction-ready

Installation

npm install @sahina/cvt-sdk

Common Features

All SDKs provide:

  • Schema Registration - Register OpenAPI v2/v3 schemas
  • Interaction Validation - Validate request/response pairs
  • Consumer Registration - Register as a consumer for deployment safety
  • Schema Comparison - Detect breaking changes between versions
  • Fixture Generation - Generate test data from schemas
  • HTTP Adapters - Automatic validation for HTTP clients
  • Producer Middleware - Automatic validation for HTTP servers

Architecture

┌─────────────────────────────────────────────────────────────┐
│ Your Application │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ Node.js │ │ Python │ │ Go │ │ Java │ │
│ │ SDK │ │ SDK │ │ SDK │ │ SDK │ │
│ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │
└────────┼──────────────┼──────────────┼──────────────┼───────┘
│ │ │ │
└──────────────┴──────────────┴──────────────┘

gRPC Protocol


┌────────────────────────┐
│ CVT Server │
│ (Port 9550) │
└────────────────────────┘

Quick Comparison

Initialization

import { ContractValidator } from "@sahina/cvt-sdk";

const validator = new ContractValidator("localhost:9550");

Validation

const result = await validator.validate(request, response);
if (!result.valid) {
console.error("Errors:", result.errors);
}

Choosing an SDK

All SDKs have equivalent functionality. Choose based on your application's language.

For detailed documentation, see the individual SDK guides: