Core
The MeshKit engine behind SDK, runtimes, providers, and security.
Core is the shared engine behind the SDK facade, runtime packages, CLI, MCP tools, providers, identity, sharing, persistence, policies, sync, proofs, and diagnostics.
Most application features should start with SDK. Use Core when you need to own infrastructure wiring or reason about the lower-level contract.
When To Use Core
| Use Core when... | Stay on the SDK facade when... |
|---|---|
You are constructing providers or loading meshkit.config.json | You only need files, records, sharing, messages, or sync |
| You need explicit identity, directory, policy, persistence, or telemetry options | Local development defaults are enough |
| You are building a runtime adapter or provider integration | You are writing feature code |
| You need exact TypeScript types and advanced namespaces | You want the shortest app import |
Core Mental Model
Core receives plaintext from the caller, encrypts it into a MeshKit envelope, writes encrypted bytes and metadata through a provider, and returns typed objects such as CIDs, proofs, capsules, messages, sync jobs, persistence proofs, and doctor reports.
Create A Core Client
import { createMeshkit, LocalDevProvider } from "@meshkit/core";
const mesh = await createMeshkit({
provider: new LocalDevProvider(),
identity: "core-demo",
});
const file = await mesh.files.put("core.txt", "encrypted by MeshKit Core");
const proof = await mesh.proofs.get(file.cid);
console.log(file.cid, proof.verified);That example uses LocalDevProvider so the wiring is visible. Replace it with provider configuration before production.
Core Owns These Boundaries
| Boundary | What Core coordinates |
|---|---|
| Encryption | Envelope creation, authenticated metadata, recipient key wrapping |
| Providers | Byte storage, proofs, capsules, mailboxes, sync jobs, logs, health |
| Identity | Local identities, export/import, publish/resolve hooks |
| Sharing | Capsules, expiry, revocation, vault checks, capability checks, policy checks |
| Persistence | Filecoin or long-term retention proof providers |
| Runtime | Browser, Node, React Native, Ionic, and platform capability assumptions |
| Observability | Doctor reports, provider logs, telemetry sinks |
Production Boundary
Core makes production setup explicit. Before shipping, centralize provider construction in one infrastructure module and document:
- Which provider stores encrypted bytes
- Which metadata service stores MeshKit proofs and workflow records
- Which identity directory resolves recipient public keys
- Which policy and persistence providers are required
- Which validation command proves the environment works
- Which logs and proof summaries are retained