Troubleshooting
Common integration issues and fixes when using the hive-cms SDK
This page focuses on SDK-based integrations.
1. Request failed with 401
Cause: invalid/revoked key or wrong host/version path.
Fix:
- confirm
HIVE_API_KEY - confirm
baseUrlis/api/publicroot - confirm
versionisv1
2. Request failed with 404
Cause: route mismatch (often duplicated /v1 or wrong host).
Fix:
- use
new Hive()with defaultHIVE_API_KEYfirst - if overriding
baseUrl, keep it as/api/publiconly - test with
await hive.stats.get()to verify connectivity
3. INVALID_API_RESPONSE
Cause: endpoint returned an unexpected payload shape.
Fix:
- check that your API host is actually Hive-compatible
- verify endpoint path and version
- inspect
HiveApiError.detailsanderror.messagecontext fields
4. Reading SDK errors clearly
HiveApiError includes formatted lines with status, code, method, path, and url.
import { HiveApiError } from 'hive-cms';
try {
await hive.posts.list();
} catch (error) {
if (error instanceof HiveApiError) {
console.error(error.message);
}
}5. Next.js and Express best practice
- call SDK in server runtime only (route handlers/controllers)
- avoid client-bundling API keys
- add caching where needed on your server boundary
Raw API troubleshooting
For HTTP-level errors, status codes, and versioning/sunset behavior, see API Reference.
- Check the documentation: Review the relevant endpoint documentation
- Verify your setup: Ensure your API key is correct and the base URL is accurate
- Test with cURL: Use the provided cURL examples to isolate the issue
- Contact support: Reach out to Hive support with:
- Your API key (you can redact part of it)
- The endpoint you're calling
- The full error message
- Steps to reproduce the issue
Quick Reference
| Error | Status Code | Solution |
|---|---|---|
| Invalid API key | 401 | Verify and correct your API key |
| Post not found | 404 | Check the post slug spelling |
| Server error | 500 | Retry after a moment |
| Rate limit exceeded | 429 | Reduce request frequency |