---
source_url: "https://github.com/workos/authkit"
title: "GitHub - workos/authkit: The world's best login box powered by WorkOS and Radix. · GitHub"
mirrored_at: 2026-08-06T15:40:07.622Z
host: github.com
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/github.com/workos/authkit"
---

> **Original source:** https://github.com/workos/authkit

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

[Explore the docs ↗](https://workos.com/docs/user-management)

## Examples

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

-   [Using AuthKit's hosted UI](https://github.com/workos/authkit/blob/main/src/app/using-hosted-authkit) 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](https://github.com/workos/authkit/blob/main/src/app/using-your-own-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](https://dashboard.workos.com/signup).

## Running the example

1.  Install dependencies with `npm install` or `yarn install`
    
2.  Set up your **Environment variables** by signing into your [WorkOS dashboard](https://dashboard.workos.com/), navigate to **API 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_.
    
    WORKOS\_CLIENT\_ID="<your Client ID>"
    WORKOS\_API\_KEY="<your Secret Key>"
    
3.  Configure redirects in your [WorkOS dashboard](https://dashboard.workos.com/), navigate to **Redirects** and add the following urls:
    
    http://localhost:3000/using-your-own-ui/sign-in/google-oauth/callback
    
    http://localhost:3000/using-your-own-ui/sign-in/microsoft-oauth/callback
    
    http://localhost:3000/using-your-own-ui/sign-in/github-oauth/callback
    
    http://localhost:3000/using-your-own-ui/sign-in/sso/callback
    
    http://localhost:3000/using-hosted-authkit/basic/callback
    
    http://localhost:3000/using-hosted-authkit/with-session/callback
    
    http://localhost:3000/using-hosted-authkit/with-nextjs/callback
    
4.  Run the example with `npm run dev` or `yarn dev` and navigate to [http://localhost:3000](http://localhost:3000/)