Server Core Utilities
Server core utilities are Node.js-specific functions designed for server-side walkerOS implementations. These utilities handle server communication, cryptographic hashing, and other backend operations.
Installation
Import server utilities from the @walkeros/server-core package:
Server Communication
sendServer
sendServer(url: string, data?: SendDataValue, options?: SendServerOptions): Promise<SendResponse>
sends HTTP requests using Node.js built-in modules (http/https).
SendServerOptions
SendResponse
Cryptographic Operations
getHashServer
getHashServer(str: string, length?: number): Promise<string> generates SHA-256
hashes using Node.js crypto module.
This function is commonly used for:
- User Anonymization: Creating privacy-safe user identifiers
- Fingerprinting: Generating device/session fingerprints
- Data Deduplication: Creating consistent identifiers
- Privacy Compliance: Hashing PII for GDPR/CCPA compliance
Usage Examples
Event Processing Pipeline
Privacy-Safe Session Tracking
Error Handling
Server utilities include comprehensive error handling:
Performance Considerations
Timeout Configuration
Configure appropriate timeouts based on your use case:
Batch Processing
For high-volume scenarios, consider batching:
Connection Reuse
The underlying Node.js HTTP agent automatically reuses connections for better performance with multiple requests to the same host.
Security Notes
- HTTPS Only: Use HTTPS URLs in production for encrypted transmission
- API Keys: Store sensitive credentials in environment variables
- Timeout Limits: Set reasonable timeouts to prevent hanging requests
- Hash Salting: Use application-specific salts when hashing sensitive data
Integration with Core
Server utilities work seamlessly with Core Utilities:
For platform-agnostic utilities, see Core Utilities.