Getting started
Requirements
Section titled “Requirements”- Node.js 20 or newer
- A TRIAS 1.2 HTTP endpoint and a valid requestor reference (
siri:RequestorRef) from the operator
Install
Section titled “Install”npm install trias-jsCreate a client
Section titled “Create a client”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});Options
Section titled “Options”| Option | Description |
|---|---|
endpoint | TRIAS service URL (POST, XML body) |
requestorRef | Your registered requestor id |
language | Optional language preference for generated XML where applicable |
timeoutMs | Request timeout in milliseconds (default 15000) |
fetch | Optional custom fetch implementation |
headers | Optional extra HTTP headers merged into each request |
The client sends POST with Content-Type: text/xml; charset=utf-8 and accepts XML responses.
First request
Section titled “First request”See Location & trip requests for locationInformation and trip examples, or Generic API for arbitrary request names.