Contributing to Bitwarden Clients
Thank you for your interest in contributing to Bitwarden! This guide will help you get started with contributing to the clients repository.The official Contributing Documentation is maintained at contributing.bitwarden.com. This page provides a quick overview and repository-specific guidance.
Getting started
Read the official guidelines
Visit contributing.bitwarden.com for comprehensive contributing guidelines covering:
- Code of conduct
- Development workflow
- Code style and conventions
- Testing requirements
- Documentation standards
Set up your development environment
Follow the installation guide to clone the repository and install dependencies:
Choose what to work on
- Browse open issues
- Look for issues labeled
good first issue - Check the project boards for planned work
- Propose your own improvements
Development workflow
1. Make your changes
Edit the code following the project’s conventions:- TypeScript - All new code must be TypeScript
- Strict typing - Avoid
anytypes when possible - Formatting - Code is auto-formatted with Prettier
- Linting - Must pass ESLint checks
2. Test your changes
Run the relevant tests for your changes:3. Build the application
Ensure your changes build successfully:4. Commit your changes
Use clear, descriptive commit messages:feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
5. Submit a pull request
Push your branch and create a pull request:- Go to github.com/bitwarden/clients
- Click “New Pull Request”
- Select your branch
- Fill out the PR template with details about your changes
- Submit for review
Code style guidelines
TypeScript conventions
Angular conventions
Naming conventions
- Files:
kebab-case.ts(e.g.,cipher-service.ts) - Classes:
PascalCase(e.g.,CipherService) - Interfaces:
PascalCase(e.g.,CipherView) - Variables/functions:
camelCase(e.g.,getCipher()) - Constants:
UPPER_SNAKE_CASE(e.g.,MAX_TIMEOUT)
Testing guidelines
Unit tests
All new features should include unit tests:Test coverage
- Aim for high test coverage on business logic
- Test edge cases and error conditions
- Use mocks for external dependencies
- Keep tests focused and isolated
Platform-specific guidelines
Each application has unique architectural requirements:- Browser extension
- Desktop
- Web
- CLI
Critical rules:
- Never use
chrome.*orbrowser.*APIs directly - useBrowserApiabstraction - Always use
BrowserApi.addListener()in popup context (Safari requires cleanup) - Use
BrowserApi.tabsQueryFirstCurrentWindowForSafari()for tab queries - Service workers can be terminated anytime - avoid assuming persistence
apps/browser/src/platform/browser/browser-api.tsPull request guidelines
PR checklist
Before submitting, ensure:- Code builds without errors
- All tests pass
- Linting passes (
npm run lint) - Code is formatted (
npm run prettier) - Commit messages follow conventions
- PR description explains the changes
- Related issue is linked (if applicable)
- Breaking changes are documented
PR review process
- Automated checks - CI runs tests and linting
- Code review - Maintainers review your code
- Feedback - Address review comments
- Approval - Maintainer approves the PR
- Merge - Changes are merged to
main
Target branch
Development tools
Recommended VS Code extensions
The repository includes recommended extensions in.vscode/extensions.json:
- ESLint - Real-time linting
- Prettier - Code formatting
- Angular Language Service - Angular IntelliSense
- Jest - Test runner integration
Workspace settings
VS Code workspace settings are provided inclients.code-workspace:
Git hooks
The repository uses Husky for git hooks:- pre-commit - Runs lint-staged (formats and lints staged files)
- commit-msg - Validates commit message format
Getting help
Resources
Official docs
Comprehensive contributing documentation
Gitter chat
Chat with the community
GitHub issues
Browse or report issues
Clients docs
Client-specific documentation
Questions?
If you have questions about contributing:- Check the Contributing Documentation
- Ask in Gitter chat
- Open a discussion on GitHub