Code of Conduct
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Our company values guide us in our day-to-day interactions and decision-making. Trust, respect, collaboration, and transparency are core values we believe should live and breathe within our projects.Our Standards
Positive behaviors:- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Attempting collaboration before conflict
- Focusing on what is best for the community
- Showing empathy towards other community members
- Violence, threats of violence, or inciting self-harm
- Sexualized language or imagery and unwelcome sexual attention
- Trolling, spreading misinformation, insulting/derogatory comments
- Public or private harassment
- Publishing others’ private information without permission
- Abuse of the reporting process
- Other conduct inappropriate in a professional setting
Reporting Issues
Instances of unacceptable behavior may be reported anonymously through this form. All complaints will be reviewed and investigated. If you are unsure whether an incident is a violation, we encourage you to report it anyway. We would prefer extra reports over letting incidents go unnoticed.Getting Started
Prerequisites
- Node.js: Version 20 LTS or newer
- pnpm: Package manager (install via
npm install -g pnpm) - Git: Version control
Environment Setup
- Fork the repository Fork auth0/nextjs-auth0 to your GitHub account.
-
Clone your fork
-
Install dependencies
-
Create a branch
Development Workflow
Available Commands
| Command | Description |
|---|---|
pnpm install | Install dependencies |
pnpm run build | Build the project |
pnpm run build:watch | Watch for changes and rebuild |
pnpm test:unit | Run unit tests |
pnpm run test:coverage | Run unit tests with coverage |
pnpm run test:e2e | Run E2E tests (requires TEST_USER_PASSWORD env var) |
pnpm run lint | Lint and typecheck |
pnpm run lint:fix | Fix linting issues |
pnpm run docs | Generate API documentation |
Building the Project
src/ to JavaScript in dist/.
Watch mode for development:
Running Tests
Unit tests:*.test.ts) in src/.
Test coverage:
*.flow.test.ts) use MSW to mock HTTP requests. No other mocks unless required.
Linting and Type Checking
Generating Documentation
Project Structure
Making Changes
Coding Standards
- TypeScript: Use TypeScript for all source files
- Formatting: Code is automatically formatted with Prettier
- Linting: Follow ESLint rules
- Tests: Write tests for new features and bug fixes
- Documentation: Update documentation for API changes
Commit Messages
Use clear, descriptive commit messages:feat: New featurefix: Bug fixdocs: Documentation changestest: Test changesrefactor: Code refactoringchore: Build/tooling changes
Testing Guidelines
Unit tests:- Test individual functions and classes
- Mock external dependencies
- Co-locate tests with source files (
*.test.ts)
- Test end-to-end authentication flows
- Use MSW for HTTP mocking
- No other mocks unless absolutely necessary
- Name files
*.flow.test.ts
Documentation
Update documentation for:- New configuration options
- New public APIs
- Breaking changes
- New features
README.md: Getting started guideEXAMPLES.md: Usage examples and patterns- API documentation: Generated from JSDoc comments
Submitting Changes
Pull Request Process
-
Ensure all tests pass
- Update documentation Add or update relevant documentation files.
-
Create a pull request
Push your branch and create a PR against
main:Go to github.com/auth0/nextjs-auth0 and click “New Pull Request”. -
Describe your changes
Provide a clear description of:
- What the change does
- Why it’s needed
- How to test it
- Breaking changes (if any)
- Wait for review Maintainers will review your PR and may request changes.
Pull Request Checklist
- All tests pass (
pnpm run test:coverage) - Linting passes (
pnpm run lint) - Build succeeds (
pnpm run build) - Documentation updated
- Commit messages follow conventions
- Changes are backwards compatible (or breaking changes documented)
- Added tests for new features
- PR description is clear and complete
Breaking Changes
If your PR includes breaking changes:- Mark it clearly in the PR title:
[BREAKING] feat: ... - Document migration steps in the PR description
- Update CHANGELOG.md with breaking change notes
- Consider deprecation before removing features
Reporting Issues
Bug Reports
When reporting bugs, include:- Description: Clear description of the issue
- Reproduction: Steps to reproduce the behavior
- Expected behavior: What you expected to happen
- Actual behavior: What actually happened
- Environment:
- SDK version (
@auth0/nextjs-auth0version) - Next.js version
- Node.js version
- Browser (if applicable)
- SDK version (
- Code sample: Minimal reproduction code
- Error messages: Full error messages and stack traces
Feature Requests
When requesting features:- Use case: Describe your use case
- Proposed solution: How you envision it working
- Alternatives: Other solutions you’ve considered
- Additional context: Any other relevant information
Security Vulnerabilities
Additional Resources
Contributing Guidelines
Documentation
- README.md: Getting started
- EXAMPLES.md: Usage examples
- API Reference: Generated API docs
- Auth0 Docs: Auth0 platform documentation
Community
- GitHub Issues: Bug reports and feature requests
- Auth0 Community: Ask questions and get help
- GitHub Discussions: Discussions and ideas