Install
Install the MeshKit SDK facade and related packages.
Install only the package your current job requires. Most application features start with the SDK facade.
Requirements
- Node.js 20.11 or newer for MeshKit package builds, scripts, and CLI usage.
- A TypeScript or JavaScript project that can use ESM imports.
- A plan for production provider credentials before you leave local development.
Application Install
npm install @meshkit/meshkitUse this for app code that calls meshkit(), mesh.files, mesh.records, mesh.share, mesh.messages, mesh.sync, or mesh.doctor.
import { meshkit } from "@meshkit/meshkit";
const mesh = await meshkit();Package Chooser
| Package | Install when | Example import |
|---|---|---|
@meshkit/meshkit | You are building an app feature and want the facade | import { meshkit } from "@meshkit/meshkit" |
@meshkit/core | You are wiring providers, policies, identity directories, telemetry, or exact types | import { createMeshkit } from "@meshkit/core" |
@meshkit/web | You need browser/PWA capability detection | import { createMeshkitWeb } from "@meshkit/web" |
@meshkit/node | You need Node-specific runtime capabilities | import { createMeshkitNode } from "@meshkit/node" |
@meshkit/react-native | You need React Native bridge and key-vault integration | import { createMeshkitReactNative } from "@meshkit/react-native" |
@meshkit/ionic | You need Ionic/Capacitor runtime integration | import { createMeshkitIonic } from "@meshkit/ionic" |
@meshkit/cli | You need terminal diagnostics or provider validation | npx -p @meshkit/cli meshkit doctor |
@meshkit/mcp | You are exposing limited MeshKit actions to an MCP agent | import { createMeshkitMcpTools } from "@meshkit/mcp" |
Do not import from an unscoped package name. The public packages use the @meshkit/* scope.
Recommended File Placement
For app code:
src/lib/meshkit.tsFor production provider construction:
src/infrastructure/meshkit.ts
meshkit.config.jsonKeep tokens in environment variables or a secret manager, not in source control. Common names include MESHKIT_PROVIDER_TOKEN, MESHKIT_FILECOIN_TOKEN, and MESHKIT_POLICY_TOKEN.
Verify The Install
Create a short smoke check:
import { meshkit } from "@meshkit/meshkit";
const mesh = await meshkit();
const report = await mesh.doctor.run();
console.log(report.provider.name);The default provider should be the local development provider unless you pass a provider or load a config.
Production Boundary
Installing the SDK is not the same as configuring production storage. With no provider option, MeshKit uses local development storage so examples are deterministic. Before production, choose and validate:
- Byte storage provider
- MeshKit metadata service
- Retrieval path
- Policy provider, if access decisions are externalized
- Persistence provider, if Filecoin or long-term retention matters
- Telemetry and audit retention
Next Steps
- Continue with SDK Quickstart.
- If you already need runtime-specific setup, read Runtimes.
- If you already need production providers, read Production setup.