Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/data-layer/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export interface Storage {
- `setData<T>(taskId, data)` - Store data with automatic metadata

**Storage Configuration:**
- Requires `NETLIFY_BLOBS_SITE_ID` and `NETLIFY_BLOBS_TOKEN` environment variables
- Requires `SITE_ID` (auto-provided by Netlify) and `NETLIFY_BLOBS_TOKEN` environment variables
- Throws error if credentials are missing (no silent fallback)
- Use `USE_MOCK_DATA=true` for local development

Expand Down Expand Up @@ -276,7 +276,7 @@ See `tests/unit/data-layer/getters.spec.ts` for test examples.
## Environment Variables

**Required for production:**
- `NETLIFY_BLOBS_SITE_ID` - Netlify Blobs site ID (required, throws error if missing)
- `SITE_ID` - Netlify site ID (auto-provided by Netlify during builds)
- `NETLIFY_BLOBS_TOKEN` - Netlify Blobs access token (required, throws error if missing)
- `TRIGGER_PROJECT_ID` - Trigger.dev project ID

Expand Down Expand Up @@ -319,7 +319,7 @@ This pulls data from Netlify Blobs storage and saves it as JSON files for local
- Regenerate mocks if needed: `npm run generate-mocks` (if script exists)

### Netlify Blobs errors
- Verify `NETLIFY_BLOBS_SITE_ID` and `NETLIFY_BLOBS_TOKEN` are set
- Verify `SITE_ID` (auto-provided by Netlify) and `NETLIFY_BLOBS_TOKEN` are set
- Check error message for specific configuration issues
- Storage will throw clear error if credentials are missing

Expand Down
7 changes: 3 additions & 4 deletions src/data-layer/storage/netlifyBlobsStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ let store: ReturnType<typeof getStore> | null = null
function getBlobStore() {
if (store) return store

const siteID = process.env.NETLIFY_BLOBS_SITE_ID
// SITE_ID is automatically provided by Netlify during builds
const siteID = process.env.SITE_ID
const token = process.env.NETLIFY_BLOBS_TOKEN

if (!siteID || !token) {
throw new Error(
"Missing NETLIFY_BLOBS_SITE_ID or NETLIFY_BLOBS_TOKEN env vars"
)
throw new Error("Missing SITE_ID or NETLIFY_BLOBS_TOKEN env vars")
}

store = getStore({
Expand Down