SvelteKit
Svelte’s compiler passes unknown tags through to the DOM unchanged, so <nlq-data> is a one-liner — no plugin config, no runtime detection.
Run it
Section titled “Run it”npx sv create nlqdb-orders # pick "minimal" + TypeScriptcd nlqdb-ordersReplace src/routes/+page.svelte with the file in this folder, then:
echo "PUBLIC_NLQDB_KEY=pk_live_yourkey" > .envnpm install && npm run dev<svelte:head>is the SvelteKit-idiomatic place for a third-party<script>; SSR injects it before any client code runs.PUBLIC_NLQDB_KEYuses SvelteKit’s$env/static/publicto make the key build-time-typed and bundle-safe (onlyPUBLIC_*env vars ever reach the client).- Svelte 5 vs 4: this file works on both — the
<script>block is unchanged. Custom elements have always passed through the Svelte compiler.
Live code
Section titled “Live code”Source on GitHub: examples/sveltekit/.