AuthKit

The world's best login box powered by WorkOS and Radix.

README

AuthKit


How to use AuthKit's hosted UI or build your own frontend with the headless User Management APIs

Examples


There are two ways to use AuthKit and this repository contains examples for both:

- Using AuthKit's hosted UI
  This is the fastest way to add authentication to your app with AuthKit and WorkOS User Management. It includes a fully themeable hosted UI that handles all of your authentication flows. When you're ready to go to production you can point it to a custom domain (auth.yourapp.com) to match your application.
- Using your own custom UI
  Use all of the features of AuthKit, but build out the UI yourself in your own codebase by integrating directly with the headless WorkOS User Management APIs. Your authentication UI will be self-hosted in your application.

Prerequisites


You will need a WorkOS account.

Environment variables


Sign in to your WorkOS dashboard, navigate toAPI Keys and copy the Client ID and the Secret Key (API Key).

Rename the .env.local.example file to .env.local and supply your _Client ID_ and _Secret Key_.

  1. ```bash
  2. WORKOS_CLIENT_ID="<your Client ID>"
  3. WORKOS_API_KEY="<your Secret Key>"
  4. ```

Redirects


In your WorkOS dashboard, navigate toRedirects and add the following urls:

  1. ```bash
  2. http://localhost:3000/using-your-own-ui/sign-in/google-oauth/callback
  3. ```

  1. ```bash
  2. http://localhost:3000/using-your-own-ui/sign-in/microsoft-oauth/callback
  3. ```

  1. ```bash
  2. http://localhost:3000/using-your-own-ui/sign-in/sso/callback
  3. ```

  1. ```bash
  2. http://localhost:3000/using-hosted-authkit/basic/callback
  3. ```

  1. ```bash
  2. http://localhost:3000/using-hosted-authkit/with-session/callback
  3. ```