Installation

Add Sparke with a single <script> tag. No package manager, no bundler, no build step.

Sparke ships as a single, dependency-free file. There's nothing to install with a package manager and nothing to bundle – you add one tag and you're done.

Add the script

Put it in the <head> with defer, on every page you want to be instant.

Self-hostedhtml
<!-- download sparke.min.js into your assets -->
<script src="/js/sparke.min.js" defer></script>
CDN (jsDelivr)html
<script src="https://cdn.jsdelivr.net/gh/benshawuk/sparke@1/sparke.min.js" defer></script>

The @1 in the CDN URL pins to the v1 major line, so you get patches and minor releases but never a breaking change.

Self-host or CDN?

Self-hosting is recommended for production: it's one more file on your own origin, with no third-party dependency on the critical path and no extra DNS lookup. The CDN is perfect for trying Sparke out or for quick demos. The minified file is about 14.5 KB (~5 KB gzipped, ~4.6 KB brotli).

Clean URLs

Sparke just fetch()es whatever URL you link to. For extensionless URLs like /about, your server must resolve them to /about.html – otherwise the browser fallback would 404.

nginxnginx
location / { try_files $uri $uri.html $uri/ =404; }

See Clean URLs for Caddy, Apache, and static-host recipes (Netlify, Vercel, GitHub Pages).

That's it

Load the site, click around, and watch navigations become instant once Sparke has preloaded its links. Nothing else is required – but if you want to fine-tune, head to Configuration.