💰 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:Network | Auth Service URL | Login Server | Usage |
---|---|---|---|
naga-dev | https://naga-dev-auth-service.getlit.dev | https://login.litgateway.com | Use Lit’s hosted endpoints while you prototype. Configure your SDK or environment variables with the URLs in this table. |
naga-test | https://naga-test-auth-service.getlit.dev | https://login.litgateway.com | Start with the hosted endpoints for staging, then switch to your own infrastructure as you scale. |
naga | Run your own (recommended) | Run your own (recommended) | Lit does not operate public Auth Service or Login Server endpoints for naga |
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)
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
- Google OAuth 2.0 (Web) client ID and client secret. Use the official guide: Get your Google API client ID.
- Discord application client ID and client secret. Follow the official guide: Discord OAuth2.
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)
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.