Astro
ActiveStatic-first with islands. Address widget as a hydrated island.
SET UP
Install
npm i @postio/address-finderEXAMPLE
30-second example
astro
--- // src/pages/checkout.astro const apiKey = import.meta.env.PUBLIC_POSTIO_KEY; --- <input id="address-search" placeholder="Start typing an address…" /> <input id="line1" /> <input id="town" /> <input id="postcode" /> <script> import { setup } from '@postio/address-finder'; setup({ apiKey: '{apiKey}', input: '#address-search', output: { address_line_1: '#line1', post_town: '#town', postcode: '#postcode', }, }); </script>
RELATED