Switching between environments
Treat the environment as configuration. Because both environments share a host, the only thing that changes between .env.development and .env.production is the API key value:
# .env.development
PERMISSIO_BASE_URL=https://api.permissio.us
PERMISSIO_API_KEY=sk_test_...
# .env.production
PERMISSIO_BASE_URL=https://api.permissio.us
PERMISSIO_API_KEY=sk_live_...
Avoid hard-coding the host. If you choose to share webhook endpoints across environments, branch on the payload's env field; otherwise, register two endpoints (one per environment) and route them differently in your infrastructure.