open-index/open-npm huggingface dataset:
npm package: @lit-protocol/auth
Description: This module provides management of auth methods that are used to control LIT PKPs, and authorization primitives.
Latest version: 8.2.3

# Quick Start

This module provides management of auth methods that are used to control LIT PKPs, and authorization primitives.

### AuthManager

An AuthManager works with `authenticators` (migrated from: @lit-protocol/lit-auth-client) to generate auth material using various methods (see: authenticators documentation).

The `AuthManager` then uses that auth material to create session credentials, and caches the resulting credentials for use with LIT network services. It also validates auth material and session material, and will attempt to get new auth material any time it detects that existing cached credentials have expired.

### node.js / browser

```
yarn add @lit-protocol/auth
```
npm package: @lit-protocol/auth-browser
Description: Browser-specific authentication utilities for the Lit Protocol, enabling seamless connection to various blockchain networks including Ethereum, Cosmos, and Solana.
Latest version: 7.4.0

# Auth Browser

Browser-specific authentication utilities for the Lit Protocol, enabling seamless connection to various blockchain networks including Ethereum, Cosmos, and Solana.

## Installation

```bash
yarn add @lit-protocol/auth-browser
```

## Quick Start

```typescript
import { checkAndSignAuthMessage } from '@lit-protocol/auth-browser';

// Generate an authSig with long expiration
const expiration = new Date(
  Date.now() + 1000 * 60 * 60 * 24 * 30
).toISOString();
const authSig = await checkAndSignAuthMessage({
  chain: 'ethereum',
  expiration: expiration,
});
```

## Key Features

- Multi-chain authentication support
  - Ethereum
  - Cosmos
  - Solana
- Convenient network connection management
- Automatic signature generation
- Flexible expiration handling
- Network disconnection utilities

## Authentication Methods

- Standard Authentication: Quick connect with default settings
- Custom Expiration: Control signature validity period
- Multi-Chain Support: Connect to different networks
- Network Management: Connect and disconnect as needed
npm package: @lit-protocol/auth-helpers
Description: This submodule manages permissions and capabilities related to accessing specific resources on the blockchain. It utilizes features from the 'siwe' and 'siwe-recap' libraries to verify and handle data, allowing users to encode and decode session capabilit
Latest version: 8.2.1

# Quick Start

This submodule manages permissions and capabilities related to accessing specific resources on the blockchain. It utilizes features from the 'siwe' and 'siwe-recap' libraries to verify and handle data, allowing users to encode and decode session capabilities, add proofs and attenuations (specific resource permissions), and verify whether certain capabilities for a resource are supported. It also provides the ability to add capabilities to 'siwe' messages and provides methods specifically tailored to the LIT protocol, enabling adding and verifying capabilities for specific LIT resources.

### node.js / browser

```
yarn add @lit-protocol/auth-helpers
```
npm package: @lit-protocol/auth-services
Description: This package contains the PKP Authentication Services & Login Server for the Lit Protocol.
Latest version: 2.1.1

# PKP Auth Services

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

# Auth Server

## Getting started

```shell
pnpm install @lit-protocol/auth-services
```

### Usage

```ts
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

```shell
pnpm install @lit-protocol/auth-services
```

### Usage

```ts
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();
```