Environments
WorkFunder provides two environments so you can develop and test without affecting production data or incurring real charges.
Live vs. Test
| Feature | Live (wf_live_) | Test (wf_test_) |
|---|---|---|
| Real payments | Yes -- Stripe charges are real | No -- payments are simulated |
| Real workers | Yes -- tasks are visible to workers | No -- no workers are assigned |
| Task auto-funding | No -- requires Stripe payment | Yes -- tasks auto-advance to funded |
| Webhooks | Delivered to your endpoint | Delivered to your endpoint |
| Rate limits | Same per-tier limits | Same per-tier limits |
| API responses | Same format | Same format |
| Task data | Production database | Separate test data |
Test Mode Behavior
When you use a test API key (wf_test_*), the following behaviors change:
No Real Charges
Tasks created with a test key skip the Stripe payment flow. The task automatically moves from pending to funded status without charging any payment method.
# This creates a task that auto-funds -- no credit card needed
curl -X POST https://api.workfunder.com/v1/tasks \
-H "Authorization: Bearer wf_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"title": "Test task",
"description": "Testing the API",
"category": "photography",
"location": {
"city": "Brooklyn",
"state": "NY",
"latitude": 40.6782,
"longitude": -73.9442
},
"budget_cents": 5000
}'
Simulated Task Progression
In test mode, tasks will not be assigned to real workers. You can use the API to advance task state for testing purposes. Webhooks are still delivered normally so you can verify your integration end-to-end.
Webhooks Still Fire
Test-mode tasks still trigger webhook events to your configured endpoint. This lets you verify your webhook handler processes events correctly without any real-world side effects.
Separate Data
Tasks created in test mode are tagged with "environment": "test" and are completely isolated from live data. Test tasks do not appear in live task listings, and live tasks do not appear in test listings.
Switching Between Environments
Switching environments is as simple as changing which API key you use. There is no environment toggle or configuration setting -- the key prefix determines the environment.
// Development / testing
const client = {
apiKey: process.env.WORKFUNDER_TEST_KEY, // wf_test_...
};
// Production
const client = {
apiKey: process.env.WORKFUNDER_LIVE_KEY, // wf_live_...
};
Recommended Setup
Use environment variables to manage keys across environments:
# .env.development
WORKFUNDER_API_KEY=wf_test_abc123...
# .env.production
WORKFUNDER_API_KEY=wf_live_xyz789...
Keep your test and live API keys in separate environment files. Never check .env files into version control.
When to Use Each Environment
| Scenario | Environment |
|---|---|
| Initial development | Test |
| Integration testing | Test |
| CI/CD pipeline tests | Test |
| Staging environment | Test |
| Webhook handler testing | Test |
| Production deployment | Live |
| Demo to stakeholders | Test (to avoid real charges) |
Test Mode Limitations
While test mode closely mirrors live behavior, there are a few differences to be aware of:
- No real worker assignment -- Tasks remain in
funded/postedstatus unless manually advanced - No real Stripe charges -- Payment intent creation is simulated
- No real payouts -- Worker transfers are not executed
- Proof uploads -- Files are stored but not reviewed by the admin queue
- GPS validation -- Still performed on proof submissions, but no real worker is submitting proofs
Moving to Production
When you are ready to go live:
- Generate a live API key (
wf_live_*) from the Dashboard - Add a payment method to your account for task funding
- Configure your production webhook URL
- Update your application to use the live API key
- Create your first live task and verify the payment flow
Live tasks create real Stripe charges and are visible to real workers. Double-check your task details and budget before creating live tasks.