Skip to main content
@provenancekit/sdk — the primary way to interact with the ProvenanceKit API from JavaScript and TypeScript.

Installation

Constructor

ProvenanceKitOptions


pk.file()

The primary method — upload a file to IPFS, record EAA provenance, and optionally anchor on-chain.

FileOpts

FileResult

Examples


pk.entity()

Register or update an entity (human, AI, or organization).

pk.graph()

Get the full provenance graph for a resource — walks backwards through all inputs, actions, and entities.

pk.bundle() / pk.provenance()

Get the full provenance bundle for a resource.
Returns a ProvenanceBundle containing entities, actions, resources, and attributions.

pk.sessionProvenance()

Get all provenance records linked to an app-managed session.
Sessions are set by passing sessionId to pk.file(). Use them to group related actions (e.g. all turns in a conversation).

pk.search() / pk.searchText()

Semantic similarity search across provenance records.

pk.similar()

Find resources similar to an existing CID using vector embeddings.

pk.getEntity() / pk.listEntities() / pk.getAIAgent()

Query entity records.

pk.ownership()

Ownership tracking for resources.

pk.health()

Health check.

Signing Utilities

Pass the public key when registering an entity, and the signingKey in ProvenanceKitOptions for auto-signing on every pk.file() call.

Error Handling

Duplicate detection

When a near-duplicate resource is uploaded, pk.file() returns (not throws) with duplicate populated: