A Reflex custom component for integrating Clerk authentication into a Reflex application.
See a Demo.
See the Docs
Any of:
uv add reflex-clerk-api
pip install reflex-clerk-api
poetry add reflex-clerk-apiimport reflex_clerk_api as clerk
def index() -> rx.Component:
return clerk.clerk_provider(
rx.container(
clerk.clerk_loaded(
clerk.signed_in(
clerk.sign_on(
rx.button("Sign out"),
),
),
clerk.signed_out(
rx.button("Sign in"),
),
),
),
publishable_key=os.environ["CLERK_PUBLISHABLE_KEY"],
secret_key=os.environ["CLERK_SECRET_KEY"],
register_user_state=True,
)Feel free to open issues or make PRs.
Usual process for contributing:
- Fork the repo
- Make changes on a feature branch
- Ideally, add tests for any changes (this will mean your changes don't get broken in the future too).
- Submit a PR
I use Taskfile (similar to makefile) to make common tasks easier. If you have that installed, you can run:
task install-- Install dev dependencies and pre-commit.task run-- Run the demo locallytask run-docs-- Run the docs locallytask test-- Run teststask bump-patch/minor/major-- Bump the version (patchfor a bug fix,minorfor an added feature).
- How should the
conditionandfallbackprops be defined onProtect? They are supposed to beJavascriptandJSXrespectively, but are juststrfor now... IsJavascriptrx.Script? AndJSXrx.Component?