Troubleshooting
Having trouble with Cruxstack Node SDK? Here are common issues and solutions.
Common Issues
1. "SDK not initialized. Call init() first."
- Solution: Ensure you call
init({ clientId })once at app startup.
2. "Category name is required and must be a non-empty string"
- Solution: Pass a valid, non-empty string as the first argument to
cruxTrack.
3. "Event tracking failed: ..."
- Solution: Validate your event payload shape. Include tenant context per event if needed (
customerId,customerName).
4. "Failed to send event: ..."
- Solution: Usually a network/API error. SDK retries automatically. If persistent, verify network access to
dev-api.cruxstack.comand confirmclientId.
5. Events not appearing in analytics
- Solution: Check the retry queue with
getQueueSize(). If events are stuck, useclearQueue()and try again.
6. Trait lookup errors
- Messages: "userIds is required", "At least one userId is required", "All userIds must be non-empty strings", "customerId is required for getUserTraits"
- Solution: Provide a string or string[] of user IDs and pass the
customerIdfor the tenant to query.
Debugging Tips
- Use
console.logto inspect event data before sending. - Confirm
clientIdis correct. - Ensure you pass
customerIdper event and for trait lookups when required. - Review error messages for hints.