Skip to content

Getting started

  • Node.js 20 or newer
  • A TRIAS 1.2 HTTP endpoint and a valid requestor reference (siri:RequestorRef) from the operator
Terminal window
npm install trias-js
import { TriasClient } from "trias-js";
const client = new TriasClient({
endpoint: "https://example.com/trias",
requestorRef: "YOUR_REQUESTOR_REF",
language: "de", // optional; used where the library adds language hints
});
OptionDescription
endpointTRIAS service URL (POST, XML body)
requestorRefYour registered requestor id
languageOptional language preference for generated XML where applicable
timeoutMsRequest timeout in milliseconds (default 15000)
fetchOptional custom fetch implementation
headersOptional extra HTTP headers merged into each request

The client sends POST with Content-Type: text/xml; charset=utf-8 and accepts XML responses.

See Location & trip requests for locationInformation and trip examples, or Generic API for arbitrary request names.