SDKs
Official Node.js SDKs for Meshes: Management API and Events.
Meshes provides official Node.js SDKs for common use cases:
- Management API SDK —
@mesheshq/api(server-to-server access using an access key + secret key) - Events SDK —
@mesheshq/events(emit workspace events using a publishable key)
Install
npm i @mesheshq/api @mesheshq/events # or pnpm add @mesheshq/api @mesheshq/events # or yarn add @mesheshq/api @mesheshq/events
Management API SDK (@mesheshq/api)
Use this SDK to call Meshes management endpoints (accounts, workspaces, integrations, rules, connections, etc.).
Authentication
Requires:
MESHES_ORGANIZATION_IDMESHES_ACCESS_KEYMESHES_SECRET_KEY
Example
import MeshesApiClient from '@mesheshq/api';
const client = new MeshesApiClient(
process.env.MESHES_ORGANIZATION_ID!,
process.env.MESHES_ACCESS_KEY!,
process.env.MESHES_SECRET_KEY!
);
const workspaces = await client.get('/workspaces');
NPM
@mesheshq/api: https://www.npmjs.com/package/@mesheshq/api
Events SDK (@mesheshq/events)
Use this SDK to emit events into a workspace using a publishable key.
Authentication
Requires:
WORKSPACE_PUBLISHABLE_KEY(orPUBLISHABLE_KEY)
Example
import MeshesEventsClient from '@mesheshq/events';
const events = new MeshesEventsClient(process.env.WORKSPACE_PUBLISHABLE_KEY!);
await events.emit({
event: 'user.signed_up',
payload: { email: 'a@b.com' },
});
NPM
@mesheshq/events: https://www.npmjs.com/package/@mesheshq/events
Runtime notes
Both SDKs use fetch. For Node, we recommend Node 18+ (global fetch available).