# @ucanto/interface

> interface definitions for ucanto

Latest version **11.0.1** (published 2025-10-24) · (Apache-2.0 AND MIT) license · 0 weekly downloads

## Install

```sh
npm install @ucanto/interface
pnpm add @ucanto/interface
yarn add @ucanto/interface
bun add @ucanto/interface
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 11.0.1 |
| Published | 2025-10-24 |
| First published | 2022-06-09 |
| Weekly downloads | 0 |
| License | (Apache-2.0 AND MIT) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 142.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 62 |
| Maintainers | gozala, it-dag-house, hugomrdias |
| Keywords | UCAN, RPC, types |

## Links

- npm: https://www.npmjs.com/package/@ucanto/interface
- Repository: https://github.com/storacha/ucanto
- Issues: https://github.com/storacha/ucanto/issues
- npm.io page: https://npm.io/package/@ucanto/interface

## Dependencies (2)

- [multiformats](https://npm.io/package/multiformats.md) ^13.3.1
- [@ipld/dag-ucan](https://npm.io/package/@ipld/dag-ucan.md) ^3.4.5

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 11.0.1 (latest) — 2025-10-24
- 11.0.0 — 2025-06-02
- 10.3.0 — 2025-05-13
- 10.2.0 — 2025-02-13
- 10.1.1 — 2025-01-22
- 10.1.0 — 2025-01-20
- 10.0.2 — 2025-01-17
- 10.0.1 — 2024-04-10
- 10.0.0 — 2024-04-04
- 9.0.0 — 2023-10-05
- 8.1.0 — 2023-09-01
- 8.0.0 — 2023-05-22
- 7.1.0 — 2023-04-27
- 7.0.1 — 2023-04-11
- 7.0.0 — 2023-04-11
- … 25 more at https://npm.io/package/@ucanto/interface/versions

## README

# @ucanto/interface

`@ucanto/interface` provides shared type definitions and contracts used across the `ucanto` ecosystem. It ensures consistent and type-safe interactions between different modules, facilitating seamless integration.

## What It Provides
- **Shared Type Definitions**: Standardized types for capabilities, invocations, and responses.
- **Interface Contracts**: Defines clear API contracts for `ucanto` modules.
- **Type Safety**: Enhances reliability through TypeScript-based type checking.

## How It Fits with Other Modules
- [`@ucanto/core`](../core/README.md): Uses the interfaces to define and execute capabilities.
- [`@ucanto/server`](../server/README.md): Implements service logic based on interface definitions.
- [`@ucanto/transport`](../transport/README.md): Adopts standardized encoding and transport interfaces.
- [`@ucanto/principal`](../principal/README.md): Uses identity-related interfaces for cryptographic operations.
- [`@ucanto/client`](../client/README.md): Ensures consistent request and response structures.

For an overview and detailed usage information, refer to the [main `ucanto` README](../../Readme.md).

## Installation
```sh
npm install @ucanto/interface
```

## Example Usage
```ts
import { Capability, Invocation } from '@ucanto/interface';

const exampleCapability: Capability = {
  can: 'file/read',
  with: 'file://example.txt'
};

const exampleInvocation: Invocation = {
  capability: exampleCapability,
  issuer: 'did:key:xyz',
  audience: 'did:key:abc'
};
```

For more details, see the [`ucanto` documentation](https://github.com/storacha/ucanto).

---
_Source: https://npm.io/package/@ucanto/interface · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
