Integrate Danish address autocomplete into Next.js 14+ with App Router: a Route Handler proxies the API key server-side, a Client Component renders typeahead. P95 < 30 ms from Danish infrastructure.
Call Danadresse server-side in a Route Handler — the API key is never exposed to the browser.
Fetch and render address data in an async Server Component — zero JS to the client for static lookups.
npm install @danadresse/client — full TypeScript support, Promise-based, zero dependencies.
// app/api/autocomplete/route.ts
export async function GET(req: Request) {
const q = new URL(req.url).searchParams.get('q') ?? ''
const r = await fetch(
`https://api.danadresse.dk/autocomplete?q=${q}`,
{ headers: { 'X-Api-Key': process.env.DANADRESSE_KEY! } }
)
return Response.json(await r.json())
}
Next.js + Stripe + Danadresse autocomplete — validated address directly in the payment flow.
Registration with server-side address validation — clean data from day one.
Deploy the Route Handler as an Edge Function — sub-10ms latency close to your users.
The slug /nextjs-adresse-api follows DAWA's conventions — same paths, same JSON shape, same UUIDs. See the migration guide for the full picture.
See also