Current version: 0.6.0
Published: npm package
Repository: GitHub
Published: npm package
Repository: GitHub
Installation
Install socket-serve and its Redis client dependency:Requirements
- Node.js 16 or higher
- Redis 6 or higher
- TypeScript 5+ (optional)
Redis Setup
Redis is required for state management and pub/sub. Configuration options:Upstash (Serverless)
Managed Redis service optimized for serverless:- Create account at console.upstash.com
- Create database
- Copy connection URL
- Configure environment:
Local Redis (Development)
Install Redis locally for development:Docker
Docker Compose configuration:docker-compose.yml
Cloud Providers
- AWS ElastiCache
- Google Cloud Memorystore
- Azure Cache for Redis
- Redis Cloud
Environment Variables
Create.env.local (Next.js) or .env:
TypeScript Configuration
Type definitions are included. Requiredtsconfig.json settings:
tsconfig.json
Import Paths
socket-serve uses subpath exports for clean imports:Verification
Redis Connection
Test Installation
test-socket.ts:
Next Steps
- Quickstart - Basic usage examples
- Next.js Integration - Next.js setup
- Express Integration - Express.js setup
- Architecture - System design
Troubleshooting
Module not found:"moduleResolution": "bundler" or "node16" in tsconfig.json
Next.js import errors:
Add to next.config.js: