Prerequisites
Before running any application, ensure you’ve completed:- Environment setup
- Dependency installation (
yarn) - Essential libraries build (
yarn build:essential)
Trezor Suite Web
The web version of Trezor Suite runs in your browser.Development Server
- Runs on
http://localhost:8000 - Hot module replacement (HMR)
- React DevTools integration
- Source maps enabled
- Fast refresh on file changes
Initial compilation takes 2-3 minutes. Subsequent updates are nearly instant with HMR.
Experimental: Vite Development
- Instant server start
- Extremely fast HMR
- Better development experience
- May not match production behavior
- Not all features may work correctly
Production Preview
Test the production build locally:- Production-optimized code
- Security headers applied
- Identical to production environment
- Served on localhost
Trezor Suite Desktop
The Electron-based desktop application.Development Server
- Electron window opens automatically
- Hot reload for renderer process
- React DevTools available
- Source maps enabled
- Native desktop features enabled
React DevTools Tip: Open DevTools first, then reload the renderer process (Cmd+R or Ctrl+R) to activate React DevTools.
Desktop Development Tips
Trezor Suite Mobile
Start Metro Bundler
Run on Android
Run on iOS
Mobile Development Commands
| Command | Alias | Description |
|---|---|---|
yarn native:start | yarn s | Start Metro bundler |
yarn native:android | yarn a | Run on Android |
yarn native:ios | yarn ios | Run on iOS |
yarn native:prebuild | yarn p | Regenerate native projects |
yarn native:reverse-ports | yarn ports | Set up Android port forwarding |
Connect Examples
Run example implementations of Trezor Connect.Available Examples
The repository includes several Connect integration examples inpackages/connect-examples/:
- webextension - Browser extension integration
- electron - Electron app integration
- react - React app integration
Running Examples
Each example has its own dev server:Connect Explorer
Interactive API explorer for testing Connect methods.- Test Connect API methods
- View request/response data
- Debug device communication
- Explore available methods
Development Environment Configuration
Optional: Enable Developer Tools
Create.env.local in the repository root:
.env.local:
Restart the dev server after modifying
.env.local.Browser DevTools Extensions
Recommended browser extensions:- React DevTools - Inspect React component tree
- Redux DevTools - Debug Redux state (if using Redux)
- React Query DevTools - Already integrated in app
Using Trezor Devices
Physical Device
Connect your Trezor device via USB. The app should detect it automatically. Troubleshooting:- Ensure device is unlocked
- Check USB cable connection
- Try a different USB port
- On Linux, verify udev rules are installed
Emulator (Recommended)
Use Trezor User Env to run device emulators. Benefits:- No physical device needed
- Test with multiple models
- Fast iteration
- Automated testing support
Multiple Apps Simultaneously
Run Multiple Development Servers
You can run multiple apps at the same time:Each app runs on a different port, so there are no conflicts.
Port Configuration
Default Ports
| Application | Port | URL |
|---|---|---|
| Suite Web | 8000 | http://localhost:8000 |
| Connect Explorer | (varies) | Check terminal output |
| Metro Bundler | 8081 | http://localhost:8081 |
Changing Ports
If a port is already in use, you can:-
Kill the process using the port:
- Configure different port (varies by package)
Performance Optimization
Faster Development
Exclude from Antivirus
On Windows, exclude the repository from Windows Defender:Troubleshooting
Module Not Found Errors
Port Already in Use
Hot Module Replacement Not Working
Desktop App Won’t Launch
Mobile App Connection Issues
Build Fails After Git Pull
Code Quality During Development
Linting
Type Checking
Formatting
Run formatting before committing. Pre-commit hooks will enforce this.
Development Workflow
Typical Daily Workflow
Build Essential Libraries (if needed)
- First time running
- Switching branches with dependency changes
- After pulling major updates
Next Steps
- Learn about Testing
- Review Code Style Guidelines
- Read Contributing Guidelines