New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

contract-kit

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contract-kit

Contract-first TypeScript framework for type-safe APIs and typed clients.

latest
Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
5
150%
Maintainers
1
Weekly downloads
 
Created
Source

contract-kit

Core meta package for Contract Kit - the contract-first TypeScript framework for building type-safe APIs and typed clients.

What's Included

This package re-exports the core Contract Kit framework:

  • @contract-kit/core - Contract definitions and builders
  • @contract-kit/client - HTTP client for contract-based requests
  • @contract-kit/application - Use case factory (commands and queries)
  • @contract-kit/domain - Domain modeling helpers (value objects, entities, domain events)
  • @contract-kit/errors - Error catalog and handling utilities
  • @contract-kit/config - Environment-first configuration layer
  • @contract-kit/ports - Port definitions and provider system
  • @contract-kit/openapi - OpenAPI 3.1 generation from contracts

What's NOT Included

This package intentionally excludes:

  • React integrations - @contract-kit/react, @contract-kit/react-query, @contract-kit/react-hook-form
  • Server adapters - @contract-kit/next, @contract-kit/server
  • Provider implementations - @contract-kit/provider-* packages

These can be installed separately as needed.

Installation

npm install contract-kit
npm install zod  # or valibot, arktype, etc.

Quick Start

import { createContractGroup, createClient } from "contract-kit";
import { z } from "zod";

// Define a contract
const todos = createContractGroup().namespace("todos");

export const getTodo = todos
  .get("/api/todos/:id")
  .pathParams(z.object({ id: z.string() }))
  .response(200, z.object({
    id: z.string(),
    title: z.string(),
    completed: z.boolean(),
  }));

// Create a typed client
const client = createClient({
  baseUrl: "https://api.example.com",
});

// Make type-safe requests
const result = await client.call(getTodo, {
  path: { id: "123" },
});

Optional Add-ons

Server Adapters

npm install @contract-kit/next next
npm install @contract-kit/server

React Integrations

npm install @contract-kit/react-query @tanstack/react-query
npm install @contract-kit/react-hook-form react-hook-form @hookform/resolvers
npm install @contract-kit/react

Providers

npm install @contract-kit/provider-logger-pino pino
npm install @contract-kit/provider-redis ioredis
npm install @contract-kit/provider-mail-resend resend
# ... and more

Documentation

For complete documentation, visit: https://github.com/taylorbryant/contract-kit

License

MIT

Keywords

contract

FAQs

Package last updated on 14 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts