Getting Started
Prerequisites
Before contributing, ensure you have:- Node.js 20.15.0 or higher
- npm 10 or higher
- Git
- A GitHub account
Repository Setup
Fork the Repository
Fork the workos-node repository to your GitHub account.
Development Workflow
Project Structure
Available Scripts
Making Changes
Write Your Code
Make your changes in the
src/ directory. The SDK is written in TypeScript with strict type checking enabled.Code Guidelines
TypeScript Style
The SDK uses strict TypeScript configuration:Code Formatting
We use Prettier for code formatting. Runnpm run format before committing.
Naming Conventions
- Files: Use kebab-case (
user-management.ts,get-user-options.interface.ts) - Classes: Use PascalCase (
WorkOS,UserManagement) - Interfaces: Use PascalCase (
User,CreateUserOptions) - Functions: Use camelCase (
getUser,listOrganizations) - Constants: Use UPPER_SNAKE_CASE (
DEFAULT_HOSTNAME,HEADER_AUTHORIZATION)
File Organization
Each module should have:Testing
Writing Tests
Tests use Jest and follow the Arrange-Act-Assert pattern:Test Coverage
Aim for high test coverage:- Unit tests for all public methods
- Integration tests for critical workflows
- Edge case and error handling tests
Running Tests
Pull Request Process
Before Submitting
Checklist
Checklist
- Code follows the project’s style guidelines
- All tests pass (
npm test) - Type checking passes (
npm run typecheck) - Code is formatted (
npm run format) - New features include tests
- Breaking changes are documented
- Commit messages are clear and descriptive
Submitting a Pull Request
Open a Pull Request
Go to the workos-node repository and click “New Pull Request”.
Fill Out the Template
Provide a clear description of your changes:
- What does this PR do?
- Why is this change needed?
- Are there any breaking changes?
- How was it tested?
PR Title Format
Use conventional commit format:feat: New featurefix: Bug fixdocs: Documentation changestest: Test additions or changesrefactor: Code refactoringchore: Build process or tooling changes
Reporting Issues
Bug Reports
When reporting bugs, include:- SDK version
- Node.js version
- Operating system
- Minimal code example to reproduce
- Expected vs actual behavior
- Error messages or stack traces
Feature Requests
For feature requests, describe:- The problem you’re trying to solve
- Your proposed solution
- Alternative solutions you’ve considered
- Any additional context
Documentation
If your changes affect the public API:- Update JSDoc comments in the code
- Update README.md if needed
- Consider if documentation site updates are needed
Release Process
Maintainers handle releases using semantic versioning:- Patch (X.Y.Z): Bug fixes, no breaking changes
- Minor (X.Y.0): New features, backwards compatible
- Major (X.0.0): Breaking changes
Code of Conduct
By contributing, you agree to:- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
- Show empathy towards others
Getting Help
Need help with your contribution?- Check existing issues
- Review pull requests
- Ask questions in your PR or issue
- Contact [email protected]
Recognition
All contributors are recognized in:- The project’s CHANGELOG.md
- GitHub’s contributors page
- Release notes
Additional Resources
GitHub Repository
View source code and open issues
API Reference
Official WorkOS API documentation
WorkOS Dashboard
Manage your WorkOS account
Community
Join the WorkOS community