Push content at build time
Add a step to your build pipeline that sends your content to the Sprigr REST API. A simple curl command or a short script in your CI/CD workflow is all you need.
Static site generators produce fast, secure websites — but they have no server to run search queries. Sprigr compiles your content into a WebAssembly module that searches entirely in the browser. Works with Hugo, Jekyll, Eleventy, Astro, and every other SSG.
Start My Free TrialStatic site generators produce HTML files that can be served from any CDN. There is no application server, no database, and no runtime. That is the point — static sites are fast, cheap, and secure because there is nothing to run.
But search needs something to run. Users type a query, and something has to score, rank, and return results. Most search solutions require a backend: Elasticsearch, Algolia, Meilisearch, or a custom API. These work, but they introduce the server dependency that static sites are designed to avoid.
Client-side alternatives exist, but they have limitations. Lunr.js is no longer actively maintained and its pure-JavaScript indexing slows down on datasets larger than a few hundred pages. Pagefind compiles indexes at build time, which works well for documentation but cannot index dynamic content like user submissions, new products, or content added after the build.
Sprigr takes a different approach. Your content is compiled into a WebAssembly module and served as a static file alongside your site. The 155 KB WASM engine loads in the browser and executes search queries locally in under 10 ms. No server, no API calls, no ongoing infrastructure.
Index your content at build time. Search happens client-side.
Add a step to your build pipeline that sends your content to the Sprigr REST API. A simple curl command or a short script in your CI/CD workflow is all you need.
Your records are compiled into a compact binary search index packaged as a WebAssembly module. A 10,000-page site typically produces a 1–5 MB index file.
Visitors load the WASM module once. Every search query runs in the browser with sub-10 ms latency, typo tolerance, faceted filtering, and highlighted results. No network calls after the initial load.
If it outputs HTML, Sprigr can add search to it.
Add the Sprigr script to your base template. Push content from a post-build script that reads your public/ directory or Hugo’s JSON output format.
Include the script tag in your default layout. Use a Rake task or a GitHub Actions step to push your _site/ content to Sprigr after jekyll build.
Add an Eleventy afterBuild event that reads your collection data and pushes it to Sprigr. Drop the script into your base Nunjucks or Liquid layout.
Load Sprigr in your Astro layout with a <script> tag. It works alongside Astro’s island architecture — the search component hydrates independently of your framework components.
Use Gatsby’s onPostBuild hook or a CI step to push your GraphQL-sourced content to Sprigr. Add the script tag via gatsby-ssr.js or the HTML head API.
Push your content to Sprigr as part of your existing build process. Here is an example using curl in a CI/CD step.
#!/bin/bash
# Run after your static site builds
# Extract content from your output directory
# (adapt the jq/script to match your SSG's output format)
curl -X POST "https://api.sprigr.com/1/indexes/your-index-id/records" \
-H "Content-Type: application/json" \
-H "X-Sprigr-API-Key: $SPRIGR_API_KEY" \
-d @records.json
You can also push records programmatically from Node.js, Python, or any language that can make HTTP requests. The API accepts JSON arrays of records with any structure — title, body, URL, tags, categories, or custom fields.
module.exports = function(eleventyConfig) {
eleventyConfig.on("eleventy.after", function() {
var fs = require("fs");
var posts = JSON.parse(fs.readFileSync("_site/search-index.json", "utf8"));
return fetch("https://api.sprigr.com/1/indexes/your-index-id/records", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Sprigr-API-Key": process.env.SPRIGR_API_KEY,
},
body: JSON.stringify(posts),
});
});
};
There are several approaches to adding search to a static site. Here is how Sprigr compares.
Lunr.js is a pure-JavaScript client-side search library. It was a solid choice when it was actively maintained, but the project has not seen significant updates in years. More importantly, Lunr loads your entire index as a JavaScript object, which causes performance problems on datasets larger than a few hundred pages. Sprigr uses a compiled WebAssembly binary that handles tens of thousands of records with sub-10 ms query times.
Pagefind is a build-time indexing tool that generates a static search index. It works well for documentation sites where content only changes at build time. However, Pagefind cannot index dynamic content — if you add a blog post, a product, or user-generated content between builds, it will not appear in search results until the next full build. Sprigr accepts new records via REST API at any time, so your search index stays current without rebuilding your site.
Algolia DocSearch is free for open-source documentation sites, but it requires an application process and is limited to docs. For commercial sites, blogs, e-commerce, or anything that is not open-source documentation, you need a paid Algolia plan with per-query pricing. Sprigr offers a 6-month free trial for everyone, with no per-query charges since all search runs client-side.
All of them. Hugo, Jekyll, Eleventy, Astro, Gatsby, Next.js static export, Pelican, Zola, MkDocs, VitePress, Docusaurus — if your SSG outputs HTML, you can add the Sprigr script tag and get instant search. The integration is framework-agnostic.
Push updated records to the Sprigr REST API. You can do this from your build pipeline, a CMS webhook, or the admin dashboard. Unlike build-time-only tools, Sprigr can accept new records at any time without requiring a full site rebuild.
Yes. The Sprigr REST API accepts new records at any time. You can push user-generated content, new products, or any data source without rebuilding your static site. The WASM index is recompiled automatically and cached by the browser on the next visit.
Sprigr handles indexes with tens of thousands of records. A typical 10,000-page documentation site produces a 1–5 MB WASM index, which loads in under a second on most connections. The index is cached by the browser, so subsequent visits load instantly.
Sprigr offers a 6-month free trial with full access for all users. There is no separate open-source tier — everyone gets the same features, including analytics, the admin dashboard, and unlimited search queries during the trial.
Full access for 6 months. No credit card required.
Start My Free Trial