Next.js quickstart
An itinerary page on the App Router: a Server Component reads the itinerary, and a Client Component draws it on a map.
1
2
Create both keys under Organization → API keys in the Mountaya app. The publishable key needs the publishing and tiles scopes.
3
Mount them in the root layout, with the stylesheet:
4
Import from @mountaya/client-react/query: it is the entry a Server Component can call.
5
6
Open /itineraries/ followed by the id of one of your published itineraries. The name arrives in the server's HTML, and the map draws in the browser.
A publishable key reads only published content. For drafts and the Data API, add a route that mints a session token with your secret key:
Then build the browser client over useSessionToken, as authentication in the SDK shows. The complete app is the examples/next-app directory of the SDK repository.