Block Protocol Type System

TypeScript definitions and utilities for typed graph data

Block ProtocolTypeScriptBeta↓ 831k

IntroductionCopy link to this section

@blockprotocol/type-system provides TypeScript definitions and utilities for data types, property types, entity types, and entities. It also describes type metadata, versioned identifiers, and provenance. Block Protocol Graph uses these definitions in its graph-service APIs.

Published release: 0.2.3 on npm.

InstallationCopy link to this section

Shell
yarn add @blockprotocol/type-system

Working with typesCopy link to this section

Use the package's exported types when describing schemas or handling typed entities in TypeScript. Its native utilities cover entities, ontology metadata, temporal values, and type URLs.

Start with the Block Protocol types guide for how data types, property types, and entity types fit together. The SemType specification defines the schemas and their composition rules.

The package README describes the type model and development workflow. The TypeScript source contains the generated definitions and native utilities. For generating application-specific TypeScript definitions from entity schemas, use Graph's codegen entry point.