MeshKit

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/meshkit

Use 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

PackageInstall whenExample import
@meshkit/meshkitYou are building an app feature and want the facadeimport { meshkit } from "@meshkit/meshkit"
@meshkit/coreYou are wiring providers, policies, identity directories, telemetry, or exact typesimport { createMeshkit } from "@meshkit/core"
@meshkit/webYou need browser/PWA capability detectionimport { createMeshkitWeb } from "@meshkit/web"
@meshkit/nodeYou need Node-specific runtime capabilitiesimport { createMeshkitNode } from "@meshkit/node"
@meshkit/react-nativeYou need React Native bridge and key-vault integrationimport { createMeshkitReactNative } from "@meshkit/react-native"
@meshkit/ionicYou need Ionic/Capacitor runtime integrationimport { createMeshkitIonic } from "@meshkit/ionic"
@meshkit/cliYou need terminal diagnostics or provider validationnpx -p @meshkit/cli meshkit doctor
@meshkit/mcpYou are exposing limited MeshKit actions to an MCP agentimport { createMeshkitMcpTools } from "@meshkit/mcp"

Do not import from an unscoped package name. The public packages use the @meshkit/* scope.

For app code:

src/lib/meshkit.ts

For production provider construction:

src/infrastructure/meshkit.ts
meshkit.config.json

Keep 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

On this page