We're so excited you're interested in helping with SuperTokens! We are happy to help you get started, even if you don't have any previous open-source experience 😊
- Take a look at How to Contribute to an Open Source Project on GitHub
- Go through the SuperTokens Code of Conduct
- Check our Github Issues to see if someone has already answered your question.
- Join our community on Discord and feel free to ask us your questions
- Python 3.8 or above
- Docker (required to run tests)
- IDE: PyCharm (recommended) or VS Code
- changie (required to add changelog entries)
brew install changie # macOS # or download a binary from https://github.com/miniscruff/changie/releases
- Fork and clone supertokens-python.
- Create and activate a virtual environment:
python3 -m venv venv && source venv/bin/activate
- Install project dependencies:
make dev-install
- Install framework-specific extras if needed:
make with-fastapi # or with-flask, with-django, with-drf - Set up git hooks (enforces version sync between
setup.pyandconstants.py):make set-up-hooks
- Open the project in your IDE and start modifying.
- Run
make lintto check for lint/type errors before committing (the pre-commit hook also runs this).
Caution
Tests create multiple applications on the SuperTokens core and must not be run against production instances. Use the Docker compose.yml provided.
-
Run all tests (starts required containers automatically):
make testSet
SUPERTOKENS_CORE_VERSIONto test against a specific core version (defaults tolatest). -
Run a specific test file or function:
docker compose up --wait pytest ./tests/path/to/test_file.py pytest ./tests/path/to/test_file.py::test_function_name
You can also use your IDE's built-in test runner: VS Code Python Testing | PyCharm Testing
Every pull request must include a changelog fragment describing the change. We use changie to manage changelog entries.
Run the following command from the repo root and follow the prompts:
changie newThis creates a small YAML file under .changes/unreleased/. Commit this file with your changes — CI will check that it exists.
Kinds to choose from:
| Kind | When to use |
|---|---|
Added |
New feature or capability |
Changed |
Change to existing behaviour |
Fixed |
Bug fix |
Breaking Changes |
Anything that breaks backwards compatibility |
Infrastructure |
CI, tooling, dependency changes |
Deprecated |
Something that will be removed in a future version |
Removed |
Removal of a feature |
Security |
Security fix |
If a PR has no user-facing impact (e.g., a documentation typo fix or test refactor), add the Skip-Changelog label on GitHub to bypass the check.
- Make sure all tests pass before submitting.
- Reference the relevant issue and give a clear description of the changes.
- Ensure the PR title follows the Conventional Commits specification (enforced by CI).
- Include a changelog fragment (see Changelog above) or add the
Skip-Changeloglabel.
- Make sure all CRUD operations are available via the
(a)?synciomodules of that recipe. - Make sure the corresponding
RecipeImplementationtakes type imports from theinterfaces.pyfile of that recipe. This allows users to copy/paste that code into their project with standard imports.
- Make sure the corresponding
APIImplementationtakes type imports from theinterfaces.pyfile of that recipe. This allows users to copy/paste that code into their project with standard imports.
make build-docsThis generates API docs in a html/ folder.
SuperTokens is made possible by a passionate team and a strong community of developers. If you have any questions or would like to get more involved:
Additional resources: