Guides

In-depth guides for using @mdrv/wsx effectively.

Core Concepts

Event Definition

Learn how to define type-safe event schemas with Zod validation.

  • Defining request/response events
  • One-way messages
  • Server-to-client pushes
  • Complex schema patterns
  • Type inference

Request/Response Pattern

Master the request/response communication pattern.

  • Sending requests from client
  • Handling requests on server
  • Error handling
  • Timeouts and retries
  • Type safety guarantees

Auto-Reconnection

Configure robust auto-reconnection behavior.

  • Reconnection strategies
  • Exponential backoff
  • Message queuing
  • Connection state management
  • Best practices

Validation

Understand how runtime validation works.

  • Zod schema validation
  • Client-side validation
  • Server-side validation
  • Error messages
  • Performance considerations

Testing

Learn how to test applications built with @mdrv/wsx.

  • Test utilities and helpers
  • Unit testing strategies
  • Integration testing patterns
  • E2E testing workflows
  • Best practices

Getting Help