Skip to main content
A private silo needs an Access Key on every request. If you put that key in front-end code, anyone can read it from the browser and use it against all of your private silos. Instead, read the silo from your own server and let your front end call that server.
You will use: a private silo and an Access Key.

The data

The examples use a Private silo named team with this JSON:
team.json

1. Store the key and URL as environment variables

.env
Add .env to your .gitignore. In production, use your host’s secret settings instead of a file.

2. Add a route that reads the silo

Each example exposes GET /api/team, which returns the silo’s data. It forwards JSONsilo’s status code when the request fails, so a 404 or 429 reaches your logs unchanged.
A route handler in the App Router. It runs on the server, so the key never reaches the browser.
app/api/team/route.js
Or read it directly in a Server Component:
app/team/page.jsx

3. Call your route from the front end

No key is involved, so this is safe to ship to the browser.

Return only what the page needs

Your route can pass Query and Search parameters through to the silo, so the browser gets a smaller response. For example, to return only active team members:
Don’t forward the browser’s query string to JSONsilo as-is. Build the parameters yourself, so a visitor can’t read fields you didn’t mean to expose.
See Product catalog with Query and Search for more recipes.

Errors to handle