MESH ONLINECODENAME:
v0.34

TypeScript SDK

Use @net-mesh/sdk for capability discovery and invocation from Node.js. @net-mesh/core supplies the lower-level event-bus surface.

shell
npm install @net-mesh/sdk @net-mesh/core

Choose the entry point

  • NetNode is the event bus. Use emit and subscribeTyped.
  • MeshNode provides capabilities, tools, and nRPC.

Node.js finalizers are not deterministic. Always await node.shutdown() and call handle.close() on RPC handles so streams and native resources drain explicitly.

Follow the capability path

  1. Quickstart
  2. Announce
  3. Discover
  4. Invoke
  5. Watch
  6. Artifacts
  7. Errors

Protected services

Both authority surfaces live in @net-mesh/core: organization auth (serveOrgTyped, TypedOrgClientconcepts) and the subnet authority plane (concepts) — mesh.serveSubnetExported(service, exportName, handler) for a provider inside a protected subnet, org.callExported(service, req) for the caller, and subnet.admin.* for runtime gateway administration. Named exports and trust anchors are configured on the mesh constructor (subnetExports, subnetAuthorities, …) and validated before the node exists. subnet:<kind> failures classify through classifySubnetError (reference).

The concepts match the other SDKs, while method names, lifecycle, and error shapes follow TypeScript and Node.js conventions.