@@ -16,7 +16,7 @@ Integration API for external systems (ERP, CI/CD, automation) built with [Fastif
1616┌─────────────────────────────────────────────────────────────┐
1717│ Step 1: Deploy API (5 min) │
1818│ Click "Deploy to Railway" button below │
19- │ Set your Supabase URL and Key │
19+ │ Set: SUPABASE_URL, SUPABASE_KEY, SUPABASE_SERVICE_KEY │
2020├─────────────────────────────────────────────────────────────┤
2121│ Step 2: Get API URL │
2222│ Railway gives you: https://your-app.railway.app │
@@ -94,6 +94,7 @@ The server will start on `http://127.0.0.1:3001` by default.
9494| ----------| ---------| -------------|
9595| ` SUPABASE_URL ` | - | Supabase project URL (required) |
9696| ` SUPABASE_KEY ` | - | Supabase anon key (required) |
97+ | ` SUPABASE_SERVICE_KEY ` | - | Service role key (required for user invites) |
9798| ` API_PORT ` | ` 3001 ` | Port to listen on |
9899| ` API_HOST ` | ` 0.0.0.0 ` | Host to bind to |
99100| ` RATE_LIMIT_MAX ` | ` 100 ` | Max requests per window |
@@ -114,20 +115,20 @@ The easiest way - no repo access needed:
1141151 . Go to [ railway.app/new] ( https://railway.app/new )
1151162 . Select ** "Deploy from Docker Image"**
1161173 . Enter: ` ghcr.io/bluerobotics/blueplm-api:latest `
117- 4 . Add variables: ` SUPABASE_URL ` , ` SUPABASE_KEY `
118+ 4 . Add variables: ` SUPABASE_URL ` , ` SUPABASE_KEY ` , ` SUPABASE_SERVICE_KEY `
1181195 . Deploy!
119120
120121** Render:**
1211221 . Go to [ render.com] ( https://render.com ) → New → Web Service
1221232 . Select ** "Deploy an existing image from a registry"**
1231243 . Enter: ` ghcr.io/bluerobotics/blueplm-api:latest `
124- 4 . Add environment variables
125+ 4 . Add environment variables: ` SUPABASE_URL ` , ` SUPABASE_KEY ` , ` SUPABASE_SERVICE_KEY `
1251265 . Deploy!
126127
127128** Fly.io:**
128129``` bash
129130fly launch --image ghcr.io/bluerobotics/blueplm-api:latest
130- fly secrets set SUPABASE_URL=https://xxx.supabase.co SUPABASE_KEY=your-key
131+ fly secrets set SUPABASE_URL=https://xxx.supabase.co SUPABASE_KEY=your-anon-key SUPABASE_SERVICE_KEY=your-service- key
131132fly deploy
132133```
133134
@@ -136,6 +137,7 @@ fly deploy
136137docker run -d -p 3001:3001 \
137138 -e SUPABASE_URL=https://xxx.supabase.co \
138139 -e SUPABASE_KEY=your-anon-key \
140+ -e SUPABASE_SERVICE_KEY=your-service-key \
139141 ghcr.io/bluerobotics/blueplm-api:latest
140142```
141143
@@ -152,6 +154,7 @@ railway init
152154# Set environment variables (get these from your Supabase project settings)
153155railway variables set SUPABASE_URL=https://xxx.supabase.co
154156railway variables set SUPABASE_KEY=your-anon-key
157+ railway variables set SUPABASE_SERVICE_KEY=your-service-key
155158railway variables set CORS_ORIGINS=https://your-erp.com,https://odoo.yourcompany.com
156159
157160# Deploy
@@ -168,6 +171,9 @@ Your API will be live at `https://your-app.railway.app`
1681714 . Copy:
169172 - ** Project URL** → ` SUPABASE_URL `
170173 - ** anon public** key → ` SUPABASE_KEY `
174+ - ** service_role** key → ` SUPABASE_SERVICE_KEY ` (required for user invites)
175+
176+ > ⚠️ ** Keep your service_role key secret!** It bypasses Row Level Security. Never expose it in client-side code.
171177
172178### Render
173179
@@ -188,6 +194,7 @@ docker build -f api/Dockerfile -t blueplm-api .
188194docker run -p 3001:3001 \
189195 -e SUPABASE_URL=https://xxx.supabase.co \
190196 -e SUPABASE_KEY=your-anon-key \
197+ -e SUPABASE_SERVICE_KEY=your-service-key \
191198 blueplm-api
192199```
193200
@@ -203,6 +210,7 @@ fly launch
203210# Set secrets
204211fly secrets set SUPABASE_URL=https://xxx.supabase.co
205212fly secrets set SUPABASE_KEY=your-anon-key
213+ fly secrets set SUPABASE_SERVICE_KEY=your-service-key
206214
207215# Deploy
208216fly deploy
@@ -1251,6 +1259,10 @@ For JSON output (production), remove the `pino-pretty` transport in `server.js`.
12511259** "Supabase not configured" error**
12521260- Set the ` SUPABASE_URL ` and ` SUPABASE_KEY ` environment variables
12531261
1262+ ** "Service key not configured" error**
1263+ - Set the ` SUPABASE_SERVICE_KEY ` environment variable (required for ` /auth/invite ` endpoint)
1264+ - Get the service_role key from Supabase Dashboard → Settings → API
1265+
12541266** "Invalid token" error**
12551267- Token may have expired - use ` /auth/refresh ` to get a new one
12561268- Ensure you're using the full token (access tokens are long JWT strings)
0 commit comments