Metadata-Version: 2.4
Name: reflex-clerk-api
Version: 1.0.0
Summary: Reflex custom component wrapping @clerk/clerk-react and integrating the clerk-backend-api
Author-email: Tim Child <timjchild@gmail.com>
License-Expression: Apache-2.0
Project-URL: documentation, https://timchild.github.io/reflex-clerk-api/about/
Project-URL: repository, https://github.com/TimChild/reflex-clerk-api
Project-URL: issues, https://github.com/TimChild/reflex-clerk-api/issues
Project-URL: homepage, https://reflex-clerk-api-demo.adventuresoftim.com
Keywords: reflex,reflex-custom-components,clerk,clerk-backend-api
Classifier: Development Status :: 4 - Beta
Classifier: Typing :: Typed
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: authlib<2.0.0,>=1.5.1
Requires-Dist: clerk-backend-api<3.0.0,>=2.0.0
Requires-Dist: reflex==0.7.5
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

![Test Status](https://github.com/TimChild/reflex-clerk-api/actions/workflows/ci.yml/badge.svg?branch=v1.0.0)
![PyPi publish Status](https://github.com/TimChild/reflex-clerk-api/actions/workflows/publish.yml/badge.svg)
![Demo Deploy Status](https://github.com/TimChild/reflex-clerk-api/actions/workflows/deploy.yml/badge.svg)

# reflex-clerk-api

A Reflex custom component for integrating Clerk authentication into a Reflex application.

See a [Demo](https://reflex-clerk-api-demo.adventuresoftim.com).

See the [Docs](https://timchild.github.io/reflex-clerk-api/about/)

## Installation

Any of:

```bash
uv add reflex-clerk-api

pip install reflex-clerk-api

poetry add reflex-clerk-api
```

## Usage

```python
import 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,
    )
```

## Contributing

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](https://taskfile.dev/) (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 locally
- `task run-docs` -- Run the docs locally
- `task test` -- Run tests
- `task bump-patch/minor/major` -- Bump the version (`patch` for a bug fix, `minor` for an added feature).


## TODO:

- How should the `condition` and `fallback` props be defined on `Protect`? They are supposed to be `Javascript` and `JSX` respectively, but are just `str` for now... Is `Javascript` `rx.Script`? And `JSX` `rx.Component`?
