Skip to main content

Node SDK

Official TypeScript SDK for MoveTheWheels, with programmatic access to drivers, vehicles, warehouses, inventory, delivery jobs, shipments, and routes.

Installation​

Install @movethewheels/sdk. Use Node.js 24.11 or later, or Bun 1.4.4 or later.

npm install @movethewheels/sdk
# or
bun add @movethewheels/sdk

Quick start​

import { MovethewheelsSDK } from '@movethewheels/sdk';

const { MOVETHEWHEELS_USERNAME, MOVETHEWHEELS_PASSWORD, MOVETHEWHEELS_WORKSPACE_ID } = process.env;
if (!MOVETHEWHEELS_USERNAME || !MOVETHEWHEELS_PASSWORD || !MOVETHEWHEELS_WORKSPACE_ID) {
throw new Error('Set the MoveTheWheels username, password, and workspace ID.');
}

const sdk = new MovethewheelsSDK({ productOrigin: 'https://app.movethewheels.com' });
await sdk.auth.signIn({ username: MOVETHEWHEELS_USERNAME, password: MOVETHEWHEELS_PASSWORD });

const workspace = (await sdk.auth.fetchWorkspaces()).find(
({ id }) => id === MOVETHEWHEELS_WORKSPACE_ID
);
if (!workspace) throw new Error('The requested workspace is unavailable to this account.');
await sdk.auth.issueWorkspaceToken(workspace.id, workspace.organizationId);

const vehicles = await sdk.movethewheels.vehicles.list(undefined, { limit: 10 });
const shipments = await sdk.movethewheels.shipments.list(undefined, { limit: 10 });

Environment selection​

The endpoints default to production. For production requests set productOrigin or MOVETHEWHEELS_ORIGIN to https://app.movethewheels.com. Use explicit endpoint overrides for local development:

MOVETHEWHEELS_WORKSPACE_ENDPOINT=http://localhost:4003/workspaces/graphql
MOVETHEWHEELS_GLOBAL_ENDPOINT=http://localhost:4000/global/graphql

Or override endpoints explicitly:

const sdk = new MovethewheelsSDK({
workspaceEndpoint: 'http://localhost:4003/workspaces/graphql',
globalEndpoint: 'http://localhost:4000/global/graphql',
});

Authentication​

  • Email / Password: sdk.auth.signIn({ username, password })
  • OAuth2 Device Code: sdk.auth.loginWithDeviceCode()
  • OAuth2 Authorization Code + PKCE: sdk.auth.buildAuthorizationUrl() + sdk.auth.exchangeAuthCode()
  • Client Credentials: sdk.auth.authenticateApp(clientId, clientSecret)
  • Workspace Token: sdk.auth.issueWorkspaceToken(workspaceId, organizationId)

Modules​

NamespaceDescription
sdk.authSign in/up, OAuth flows, token management
sdk.movethewheelsDomain operations for customers, drivers, vehicles, warehouses, inventory, delivery jobs, shipments, tracking, routes, marketplace, settings, and analytics
sdk.sandboxEphemeral sandbox environments
sdk.billingSubscriptions, invoices, plans
sdk.channelsChannel-based pub/sub
sdk.conversationsConversation CRUD
sdk.devportalApps, OAuth, API keys, webhooks
sdk.exportExport jobs, templates
sdk.filesBrowse, upload, share
sdk.groupsGroup management
sdk.healthGateway/service health
sdk.integrationsThird-party integrations
sdk.notificationsNotification center
sdk.organizationsOrganizations + invites
sdk.productsFeature flags, content pages
sdk.rbacPermissions, role assignment
sdk.schedulerScheduled jobs
sdk.securityVaults, secrets
sdk.storeMarketplace
sdk.supportTickets, knowledge base
sdk.tagsTag CRUD
sdk.toursOnboarding tours
sdk.workspacesWorkspace CRUD + members

Error handling​

import { AuthenticationError, NetworkError } from '@movethewheels/sdk';

try {
await sdk.auth.signIn({ username: 'invalid', password: 'invalid' });
} catch (error) {
if (error instanceof AuthenticationError) {
console.error('Auth failed:', error.message);
} else if (error instanceof NetworkError) {
console.error('Network error:', error.message);
}
}

Source​

The source repository is github.com/algoshred/movethewheels-sdk-node.

Next steps​