Vignette ID SDK and client libraries

A JavaScript client, a CLI, and a typed client in any language from the OpenAPI document

The Vignette ID public API is small enough to call with fetch, and every response is plain JSON. Where a client helps is error handling and types, so the JavaScript client turns every failure into a typed error carrying the server's own code and hint, and the OpenAPI document is complete enough to generate the same thing in any other language.

JavaScript and TypeScript

The JavaScript client ships in the Vignette ID CLI package and is usable as a library. createClient() returns listCountries, getCountry and listProducts. It has no dependencies and runs on Node 18 or newer, in a server, a Lambda or a script.

Every failure throws an ApiError carrying the server's own code, message and hint, so you branch on error.code — not_found, invalid_parameter, rate_limited and the rest — rather than on a message string that may be reworded.

Command line

The same package installs a vignette command for shell use and scripting: vignette countries lists the covered countries, vignette country at prints one country's toll rules, and vignette prices at shows live prices. Add --json to any command to get the raw API response for piping into jq.

Any other language

Generate a client from https://e-vignettes.eu/openapi.json. It is a valid OpenAPI 3.1 document with a unique operationId, typed parameters and a response schema on every operation, so openapi-generator, Kiota, oapi-codegen and the rest consume it without hand-editing. The document is generated from the same source the API is served from, so a generated client cannot lag the contract.

Nullable fields are declared as nullable: a product's vehicle_type is null on section tolls, which are priced per crossing rather than per vehicle class. A generator that honours the schema will produce an optional type there.

MCP, for agents

Agents that speak the Model Context Protocol need no client library at all: https://e-vignettes.eu/mcp exposes the same catalogue as four tools over Streamable HTTP, unauthenticated. The manifest is discoverable at /.well-known/mcp.json.