You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deploy-environment-variables.mdx
+52-1Lines changed: 52 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -360,4 +360,55 @@ This will read your .env.production file using dotenvx and sync the variables to
360
360
361
361
- Trigger.dev does not automatically detect .env.production or dotenvx files
362
362
- You can paste them manually into the dashboard
363
-
- Or sync them automatically using a build extension
363
+
- Or sync them automatically using a build extension
364
+
365
+
## Multi-tenant applications
366
+
367
+
If you're building a multi-tenant application where each tenant needs different environment variables (like tenant-specific API keys or database credentials), you don't need a separate project for each tenant. Instead, use a single project and load tenant-specific secrets at runtime.
368
+
369
+
<Note>
370
+
This is different from [syncing environment variables at deploy time](#sync-env-vars-from-another-service).
371
+
Here, secrets are loaded dynamically during task execution, not synced to Trigger.dev's environment variables.
372
+
</Note>
373
+
374
+
### Recommended approach
375
+
376
+
Use a secrets service (Infisical, AWS Secrets Manager, HashiCorp Vault, etc.) to store tenant-specific secrets, then retrieve them at the start of each task run based on the tenant identifier in your payload or context.
377
+
378
+
**Important:** Never pass secrets in the task payload, as payloads are logged and visible in the dashboard.
// Your task logic using the tenant-specific secret
400
+
// ...
401
+
},
402
+
});
403
+
```
404
+
405
+
You can use any secrets service - see the [sync env vars section](#sync-env-vars-from-another-service) for an example with Infisical.
406
+
407
+
### Benefits
408
+
409
+
-**Single codebase** - Deploy once, works for all tenants
410
+
-**Secure** - Secrets never appear in payloads or logs
411
+
-**Scalable** - No project limit constraints
412
+
-**Flexible** - Easy to add new tenants without redeploying
413
+
414
+
This approach allows you to support unlimited tenants with a single Trigger.dev project, avoiding the [project limit](/limits#projects) while maintaining security and separation of tenant data.
Copy file name to clipboardExpand all lines: docs/limits.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,14 @@ If you add them [dynamically using code](/management/schedules/create) make sure
55
55
56
56
If you're creating schedules for your user you will definitely need to request more schedules from us.
57
57
58
+
## Projects
59
+
60
+
| Pricing tier | Limit |
61
+
| :----------- | :----------------- |
62
+
| All tiers | 10 per organization |
63
+
64
+
Each project receives its own concurrency allocation. If you need to support multiple tenants with the same codebase but different environment variables, see the [Multi-tenant applications](/deploy-environment-variables#multi-tenant-applications) section for a recommended workaround.
0 commit comments