Skip to main content
The official Solvice VRP Solver SDK is now available! Install it today to streamline your route optimization integrations.

Installation

Install the SDK using your preferred package manager:

Quick Start

Get up and running with the VRP Solver in minutes:

Key Features

Type Safety

Full TypeScript support with comprehensive type definitions for all request and response objects

Auto Retry

Built-in retry logic with configurable attempts for resilient integrations

Modern Runtime Support

Works in Node.js, Deno, Bun, browsers, and Cloudflare Workers

Error Handling

Typed error responses with detailed debugging information

Configuration

Configure the SDK client with these options:
Never hardcode your API key. Always use environment variables or secure key management systems.

Advanced Usage

Asynchronous Solve with Polling

For large routing problems, use the asynchronous solve method:

Error Handling

The SDK provides typed error responses for better debugging:

Using with Real Road Distances

Enable real-world routing distances instead of straight-line calculations:

Runtime Support

The SDK supports multiple JavaScript runtimes:
Requires Node.js 20 LTS or later:

Complete Example

Here’s a comprehensive example showcasing various SDK features:

API Methods

The SDK provides access to all VRP Solver endpoints:

Core Methods

  • syncSolve() - Synchronous solving for smaller problems
  • solve() - Asynchronous solving for larger problems
  • jobs.status() - Check job status
  • jobs.solution() - Retrieve solution

Advanced Methods

  • evaluate() - Evaluate an existing solution
  • suggest() - Get improvement suggestions
  • jobs.explanation() - Get detailed explanations
For problems with more than 100 jobs or complex constraints, use the asynchronous solve() method to avoid timeouts.

Resources

GitHub Repository

View source code and contribute

npm Package

View on npm registry

API Reference

Complete API documentation

Support

Get help from our team