Skip to main content

Reflex custom component wrapping @clerk/clerk-react and integrating the clerk-backend-api

Project description

Test Status PyPi publish Status Demo Deploy Status

reflex-clerk-api

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

See a Demo.

See the Docs

Installation

Any of:

uv add reflex-clerk-api

pip install reflex-clerk-api

poetry add reflex-clerk-api

Usage

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 (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?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reflex_clerk_api-1.1.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reflex_clerk_api-1.1.3-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file reflex_clerk_api-1.1.3.tar.gz.

File metadata

  • Download URL: reflex_clerk_api-1.1.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for reflex_clerk_api-1.1.3.tar.gz
Algorithm Hash digest
SHA256 35d424c7b26df5c8a7cf3be76da7f936ad799ddac463cee3b56ec02aec856d6a
MD5 44aaac4f3d21f67bd80854ae63bf10ec
BLAKE2b-256 089b5eee829c25eeafdf12cdcf772e97516d986432e286b5402463ed5f25cd0d

See more details on using hashes here.

File details

Details for the file reflex_clerk_api-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for reflex_clerk_api-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7d3af18d6b3c1ec9cd3ee7e142a6ffad635445af0a8ad28fb10ea7f74c886e89
MD5 7981c139045dd7f3c49ef0f49c84aaf9
BLAKE2b-256 03153be2fd3440716f478b786a245a2dfae587d0aad8b4181242f42e82c33e00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page