API Setup
Before It's Gone integrates with several external services. Most are free and require no account. This page covers what each service does, whether you need to configure it, and how.
Overview
| Service | Purpose | Account required | API key required |
|---|---|---|---|
| Open Food Facts | Barcode lookup, nutritional info | No | No |
| TheMealDB | Recipe suggestions | No | No |
| Resend | Email notifications | Yes (free tier available) | Yes |
| Supabase | Optional cloud sync | Yes (free tier available) | No (anon key only) |
Open Food Facts
What it does: Looks up barcodes to retrieve product names, categories, kcal per 100g, and allergen tags. Used by:
- The phone scanner's product review card
- Barcode field lookup in the Add Item form
- Batch barcode import
| Account required | No |
| API key required | No |
| Cost | Free (Open Food Facts is a non-profit open database) |
Endpoints used:
GET https://world.openfoodfacts.org/api/v2/product/{barcode}.json
Rate limits: Open Food Facts does not publish a hard rate limit, but excessive automated queries are discouraged. The batch barcode import processes one barcode at a time sequentially to stay within reasonable usage.
Data sent: The barcode string only. No personal data, no inventory content.
Troubleshooting
- Barcode returns no result: The product may not be in Open Food Facts yet; it's community-contributed. You can add it at world.openfoodfacts.org. Also check the barcode was scanned or entered correctly (EAN-13, UPC-A, etc.).
TheMealDB
What it does: Suggests recipes when 3 or more items in your inventory are expiring or expired. The app uses the free tier (API v1, no key needed).
| Account required | No |
| API key required | No (the free tier uses the string 1 as the key, handled internally) |
| Cost | Free |
Endpoint used:
GET https://www.themealdb.com/api/json/v1/1/filter.php?i={ingredient}
Data sent: The first word of the first expiring item's name (e.g. chicken, milk). No personal data.
Trigger: Automatic when 3+ items are expiring or expired. Dismissed for the current calendar day if you click the × button. Re-appears the next day if items are still expiring.
Troubleshooting
- Recipe suggestions don't appear: At least 3 items must be in an expiring-soon or expired state simultaneously. The banner is dismissed for the rest of the calendar day when you click ×. TheMealDB may not have recipes for every ingredient; the banner only appears if results are returned.
Resend
What it does: Delivers email notifications (expiry alerts, digests) from the desktop app. Resend is the recommended provider: one API key, no mail server required.
| Account required | Yes |
| API key required | Yes |
| Cost | Free tier: 3,000 emails/month and 100/day |
Setup
- Go to resend.com and create an account.
- Navigate to API Keys → Create API Key. Give it a name and set Permission to Sending access.
- Copy the key: it starts with
re_and is shown only once. - Open the app → Settings → Email Notifications.
- Set Provider to Resend, paste the key, enter a recipient email, and click Save email settings.
- Click Send test email to verify.
For the full email notifications guide including SMTP, digest scheduling, and troubleshooting, see Email Notifications.
Supabase
What it does: Provides optional cloud sync. You create and own the Supabase project; AetherAssembly has no access to it.
| Account required | Yes (at supabase.com) |
| API key required | No; the app uses the project's public anon key, which is safe to store in localStorage |
| Cost | Free tier: 500 MB database, unlimited auth users |
Security model
The anon key is a publishable key; it is safe to store client-side. All access is controlled by Supabase's Row Level Security policy, which restricts each user to only their own rows. Without a valid authenticated session, the anon key cannot read or write any data.
For the full setup walkthrough including the required SQL migration, see Cloud Sync.