Coder Social home page Coder Social logo

reflex-clerk's Introduction

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:

  1. We import the necessary components from Reflex and the reflex_clerk library.
  2. We define the publishable_key for our Clerk instance.
  3. We create a function index that returns a Reflex component.
  4. 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.
  5. 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.
  6. We pass the publishable_key to the clerk_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

reflex-clerk's People

Contributors

kroo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.