Quickstart
Build and validate your first Fide Context Protocol statement.
Install
pnpm add @fide-work/context-protocol@alphaBuild A Statement
import { buildStatement } from "@fide-work/context-protocol";
const statement = await buildStatement({
subject: {
entityType: "Person",
referenceType: "NetworkResource",
referenceIdentifier: "https://en.wikipedia.org/wiki/Andrej_Karpathy",
},
property: {
entityType: "DirectionalProperty",
referenceType: "NetworkResource",
referenceIdentifier: "https://schema.org/name",
},
object: {
entityType: "TextLiteral",
referenceType: "TextLiteral",
referenceIdentifier: "Andrej Karpathy",
},
});What You Get
The SDK derives deterministic Fide IDs for:
- the subject
- the property
- the object
- the statement itself
It also returns a complete FCP statement object with the required identifiers and reference identifiers.
Validate The Result
Use the SDK when you need to enforce FCP structure and property policy before writing statements to storage or passing them to downstream graph systems.
The most common errors are:
- non-canonical property identifiers
- invalid entity-type/reference-type combinations
- missing or malformed reference identifiers
Next Steps
- Read Specification Overview.
- Review Statements.
- Review Fide ID.
- Explore Fide Vocabulary.
- Use the JavaScript SDK Reference.