Reflex custom component library for Clerk, a user management platform
Project description
clerk
A Reflex custom component clerk.
Installation
pip install reflex-clerk
Usage
import reflex as rx
from reflex_clerk import clerk_provider, sign_in_button, install_signin_page
publishable_key = "your_clerk_publishable_key"
def index() -> rx.Component:
return clerk_provider(
rx.vstack(
sign_in_button(),
align="center",
spacing="7",
),
publishable_key=publishable_key,
)
app = rx.App()
app.add_page(index)
install_signin_page(app)
In this example:
- We import the necessary components from Reflex and the
reflex_clerk
library. - We define the
publishable_key
for our Clerk instance. - We create a function index that returns a Reflex component.
- Inside the index function, we use the
clerk_provider
component from reflex_clerk. This component sets up the Clerk context for the rest of the components within it. - Within the
clerk_provider
, we create a vertical stack (rx.vstack) that contains the sign_in.sign_in_button() component from reflex_clerk. This component renders a sign-in button for Clerk. - We pass the
publishable_key
to theclerk_provider
component.
With this setup, you'll have a page that displays a sign-in button powered by Clerk. You can then add more Clerk components, such as user profile information, sign-out buttons, and more, within the clerk_provider.
Further documentation can be found in the reference docs
License
Apache-2.0
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Acknowledgments
Project details
Release history Release notifications | RSS feed
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-1.0.0.tar.gz
(18.9 kB
view hashes)
Built Distribution
Close
Hashes for reflex_clerk-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf4a3363135acbd466c028cfe7014e49f129e45ccfb5e15e3dfdeece1a24e74 |
|
MD5 | 1e0d864b6c21f6e21ab848d5b4a3e50a |
|
BLAKE2b-256 | 122d1843d3656e005921be9141b1102ce746f5b053ac3e54ae02991b3a04f22d |