Debugging
Tips for debugging API requests and SDK issues.
Updated
On this page
Common Issues
1. "Unauthorized" Errors
// Check your API key is set correctly
console.log(process.env.NEXT_PUBLIC_DASH4DEVS_API_KEY)
// Should start with "pk_"
2. Empty Product Lists
- Verify products are published in the dashboard
- Check that the API key belongs to the correct organization
- Try the ping endpoint to verify your key
3. CORS Errors
If you see CORS errors in the browser console, check that your domain is in the allowed origins list. See CORS Errors.
Ping / Health Check
import dash from "@/lib/dash"
const info = await dash.ping()
// Returns organization info if API key is valid
console.log(info)
Enable Debug Mode
// Show analytics debug overlay
dash.tracking.debug()
Network Debugging
Open browser DevTools → Network tab to inspect API requests. Look for:
- Request URL and headers (is the API key being sent?)
- Response status codes
- Response body for error messages
Next Steps
- Error Codes — Full error reference
- CORS Errors — Fixing CORS issues
- Authentication Issues — Auth troubleshooting