@atproto/pds
TypeScript reference implementation of an atproto Personal Data Server (PDS). The PDS is responsible for hosting user data, managing identities, and coordinating with the wider AT Protocol network.If you are interested in self-hosting a PDS for production use, see the official PDS distribution repository which includes deployment configuration, documentation, and Docker support.
Installation
Overview
The PDS package provides the core server implementation for hosting user repositories, managing authentication, handling blob storage, and synchronizing data with AppViews and other services in the AT Protocol network. Key responsibilities:- User account management and authentication
- Repository hosting and data storage
- Blob (media) storage and management
- Event sequencing and synchronization
- Identity resolution (DIDs and handles)
- OAuth provider implementation
- Email verification and invites
Main Exports
PDS Class
The main server class that orchestrates all PDS functionality.Methods
static async create(config: ServerConfig, secrets: ServerSecrets, overrides?: Partial<AppContextOptions>): Promise<PDS>
Creates a new PDS instance with the provided configuration.
async start(): Promise<http.Server>
Starts the PDS server and begins listening for requests.
async destroy(): Promise<void>
Gracefully shuts down the server and cleans up resources.
AppContext
The application context contains all shared services and dependencies.Database
Database interface for PDS data access.DiskBlobStore
Disk-based blob storage implementation.Configuration
ServerConfig
Complete server configuration interface.ServiceConfig
Core service configuration.DatabaseConfig
SQLite database configuration.Blobstore Configuration
S3 Blobstore
Disk Blobstore
IdentityConfig
Identity resolution configuration.RateLimitsConfig
Rate limiting configuration.OAuthConfig
OAuth provider configuration.Environment Variables
The PDS reads configuration from environment variables:Service
Database
Blobstore (S3)
Blobstore (Disk)
Identity
Entryway (Optional)
Rate Limits
Redis (Optional)
Setup Example
Complete setup example:Repository Operations
The PDS manages user repositories:Sequencer
The sequencer handles event streaming:Authentication
The PDS includes OAuth provider and session management:Lexicon Server
Create and configure the XRPC server:Related Packages
@atproto/xrpc-server- HTTP API server library@atproto/repo- Repository management@atproto/identity- Identity resolution@atproto/oauth-provider- OAuth provider