lkmeet-livekit-client-utils v0.1.0
library
capsule://quake0day/[email protected]
Provides a collection of client-side utility functions and types essential for interacting with LiveKit, including E2EE passphrase handling, random string generation, LiveKit URL manipulation, and performance optimization hooks.
Owns
- E2EE passphrase encoding/decoding
- Room ID and random string generation
- LiveKit URL construction logic
- Client-side performance optimization hooks
- Common LiveKit-related types
Does not own
- LiveKit client SDK itself
- UI components
AI orientation
This capsule contains core client-side logic. Ensure `decodePassphrase` correctly handles URL hashes for E2EE. `getLiveKitURL` should accurately modify LiveKit Cloud URLs based on region. `useLowCPUOptimizer` must correctly detect and respond to CPU constraints. All types in `types.ts` should be robust.
Provides
library:client-utils— Functions for passphrase encoding, random strings, room IDs, and device detection.library:getLiveKitURL— Function to construct LiveKit server URLs, including region handling.library:types— TypeScript type definitions for LiveKit client interactions.library:useLowCPUOptimizer— React hook for optimizing LiveKit client performance on low-CPU devices.library:useSetupE2EE— React hook for setting up LiveKit E2EE worker and retrieving passphrase.
Invariants (must always hold)
- E2EE passphrase encoding/decoding must be symmetrical.
- Generated room IDs must be unique and short.
- LiveKit URL construction must correctly handle different hostnames and staging environments.
Source files (6)
Click any file to view its content; the path on the right shows where the file lands when this capsule is installed.
src/lib/client-utils.ts→src/lib/client-utils.tssrc/lib/getLiveKitURL.test.ts→src/lib/livekit-url.test.tssrc/lib/getLiveKitURL.ts→src/lib/livekit-url.tssrc/lib/types.ts→src/lib/types.tssrc/lib/usePerfomanceOptimiser.ts→src/hooks/use-performance-optimiser.tssrc/lib/useSetupE2EE.ts→src/hooks/use-e2ee-setup.ts
Plus capsule.yaml and
install.json.