This directory contains specific customisations for each endpoint, called profiles. They parse data from the API differently, add additional information, or add special methods specific to the endpoint (such as journeysFromTrip
).
There are built-in profiles for these public transportation networks:
If you want to write a profile for an endpoint, check out the writing a profile guide.
Your profile must be passed into createClient
and is expected to be in a certain structure:
import {createClient} from 'hafas-client'
const myCustomProfile = {
// …
}
// create a client with the profile
const client = createClient(myCustomProfile)
// use it to query data
await client.journeys('1234', '2345')