Skip to main content
💰 Need Test Tokens? Visit the Chronicle Yellowstone Faucet to get test tokens for your EOA account.

Overview

The Lit Protocol Auth Services package helps you run the infrastructure required to mint Programmable Key Pairs (PKPs) and power OAuth-based sign-in flows.
  • Auth Service: Handles PKP minting for supported auth methods and exposes APIs consumed by the Lit JS SDK.
  • Login Server: Manages OAuth flows (Google, Discord, etc.) and issues short-lived session tokens that the Auth Service consumes.

Hosted Auth Services

Lit hosts default Auth Service instances so you can build without deploying infrastructure on day one. Point your application to the URL that matches the network you’re targeting:
The hosted services are best suited for prototyping. Self-host the Auth Service and Login Server for production traffic or when you need custom configuration.

Install the SDK

Run the following command to install the SDK: (Only available using Bun to install at the moment.)

Lit Auth Service

Choose how to run:
  • One-click Deploy (Railway)
  • Container image (Docker)
  • Use the package (Node.js)

One-click Deploy (Railway)

Deploy on Railway

Container image

Use the package (Node.js)

1

Create the Lit Auth Service

Create the Lit Auth Service instance.
2

Start the background worker

3

Setup environment variables

Setup the environment variables.

Lit Login Server

Prerequisites

You should set the callback/redirect URLs to the same domain as the Login Server. eg. > - https://your-domain.com/auth/discord/callback > - https://your-domain.com/auth/google/callback

One-click Deploy (Railway)

Deploy on Railway

Container image

Use the package (Node.js)

1

Create the Lit Login Server

Create the Lit Login Server instance.
2

Setup environment variables

When you run a custom Login Server, the DISCORD_CLIENT_ID is embedded into the authMethodId that Lit nodes use to locate the correct PKP. Make sure the value matches the client ID you used when minting the Discord auth method.