Skip to main content
When building applications with DFNS, you’ll typically want separate environments for development, staging, and production. This guide covers best practices for setting up and managing multiple DFNS organizations for environment separation.

When to use multiple organizations

Use separate organizations for each environment when:
  • You need isolated wallets, users, and policies per environment
  • You want to test policy changes without affecting production
  • Different team members should have access to different environments
  • You need to prevent accidental production operations during development
Each DFNS organization is fully isolated. Wallets, users, policies, and configurations in one organization cannot access or affect another organization.

Setting up your organizations

Contact our to create organizations for each environment. We recommend a naming convention that clearly identifies each environment:
The same email address can be used to create separate user accounts in different organizations. This allows your team members to access all environments with familiar credentials.

Service accounts per environment

As for the rest of the configuration, you will need to create separate service accounts for each environment. We recommend to use separate keys for each one of them. This provides:
  • Isolation: Compromised development credentials can’t affect production
  • Audit trails: Clear attribution of which environment performed actions
  • Different permissions: Broader permissions in dev, restricted in production
1

Generate unique keypairs per environment

Create separate keypairs for each environment:
2

Create service accounts in each organization

In each organization’s dashboard:
  1. Navigate to Settings > Developers > Service Accounts
  2. Create a service account with the corresponding public key
  3. Save the authentication token securely
3

Assign appropriate permissions

Consider granting broader permissions in development for easier testing, while restricting production to the minimum required:

Configuration management

Environment variables

Structure your configuration to switch between environments:
config.ts

Secrets management

Store credentials securely using a secrets manager:
Never commit service account tokens or private keys to version control.
Example .env structure:
.env.development

Policies and permissions

Policies and permissions must be configured separately in each organization. Consider:

Development environment

  • Simpler policies or no policies for rapid iteration
  • Broader permissions for all developers
  • Use testnet chains only

Staging environment

  • Mirror production policies to catch issues before release
  • Test policy changes here before applying to production
  • Use testnet chains for most testing

Production environment

  • Strict policies with appropriate approval requirements
  • Minimum necessary permissions
  • Mainnet chains for real transactions
Document your production policies and permissions so you can replicate them in staging for accurate testing.

Webhooks

Configure webhooks separately for each environment to send events to the appropriate endpoints: For local development, use a tunneling service to receive webhooks on your local machine.

Create a service account

Step-by-step service account setup

Configure WebAuthn

Configure passkeys for multiple domains

Manage policies via API

Set up transaction policies

Set up webhooks

Configure event notifications
Last modified on June 8, 2026