🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@lit-protocol/auth-services

Package Overview
Dependencies
Maintainers
8
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lit-protocol/auth-services

This package contains the PKP Authentication Services & Login Server for the Lit Protocol.

latest
npmnpm
Version
2.1.1
Version published
Maintainers
8
Created
Source

PKP Auth Services

This package contains the PKP Authentication Services & Login Server for the Lit Protocol.

Auth Server

Getting started

pnpm install @lit-protocol/auth-services

Usage

import { createLitAuthServer } from '@lit-protocol/auth-services';
import { startAuthServiceWorker } from '@lit-protocol/auth-services';

const litAuthServer = createLitAuthServer({
  port: Number(3001),
  host: '0.0.0.0',
  network: process.env['NETWORK'],
  litTxsenderRpcUrl: process.env['LIT_TXSENDER_RPC_URL'] as string,
  litTxsenderPrivateKey: process.env['LIT_TXSENDER_PRIVATE_KEY'],
  enableApiKeyGate: true,
  stytchProjectId: process.env['STYTCH_PROJECT_ID'],
  stytchSecretKey: process.env['STYTCH_SECRET'],
  maxRequestsPerWindow: Number(process.env['MAX_REQUESTS_PER_WINDOW']),
  windowMs: Number(process.env['WINDOW_MS']),
  redisUrl: process.env['REDIS_URL'] as string,
});

// Start the auth server
await litAuthServer.start();

// Requires REDIS_URL
await startAuthServiceWorker({
  litTxsenderRpcUrl: process.env['LIT_TXSENDER_RPC_URL'] as string,
  redisUrl: process.env['REDIS_URL'] as string,
});

Login Server

Getting started

pnpm install @lit-protocol/auth-services

Usage

import { createLitLoginServer } from '@lit-protocol/auth-services';

const litLoginServer = createLitLoginServer({
  port: Number(process.env['LOGIN_SERVER_PORT']),
  host: process.env['LOGIN_SERVER_HOST'],
  stateExpirySeconds: 30,
  socialProviders: {
    google: {
      clientId: process.env['LOGIN_SERVER_GOOGLE_CLIENT_ID'] as string,
      clientSecret: process.env['LOGIN_SERVER_GOOGLE_CLIENT_SECRET'] as string,
    },
    discord: {
      clientId: process.env['LOGIN_SERVER_DISCORD_CLIENT_ID'] as string,
      clientSecret: process.env['LOGIN_SERVER_DISCORD_CLIENT_SECRET'] as string,
    },
  },
});

await litLoginServer.start();

FAQs

Package last updated on 27 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts