Troubleshooting
Common issues and solutions for the Knidian SDK.
Installation Issues
CDN Script Not Loading
Symptoms: SDK script fails to load from CDN
Causes:
- Network/firewall blocking CDN
- Incorrect CDN URL
- CORS issues
Solutions:
-
Verify CDN URL:
<!-- Correct URL -->
<script src="https://cdn.knidian.ai/sdk/v1/knidian-sdk.min.js"></script> -
Check browser console for specific error messages
-
Test CDN accessibility:
curl https://cdn.knidian.ai/sdk/v1/knidian-sdk.min.js -
Whitelist CDN in firewall:
cdn.knidian.ai
Initialization Issues
"Authentication Failed" Error
Symptoms: SDK fails to initialize with authentication error
Causes:
- Backend auth endpoint not reachable
- Session token generation failing
- API key incorrect in backend
- Network/CORS issues
Solutions:
-
Verify auth endpoint is running:
curl -X POST https://your-backend.com/api/knidian-auth \
-H "Content-Type: application/json" \
-d '{"userId": "test-user"}' -
Check backend API key (in your backend code):
// Backend .env file should have:
// KNIDIAN_API_KEY=kn_live_... (for production)
// KNIDIAN_API_KEY=kn_test_... (for testing) -
Verify CORS is configured to allow your frontend origin
-
Contact support to verify/rotate API key: licensing@knidian.ai
Container Not Found
Symptoms: SDK doesn't render, console shows "Container not found"
Causes:
- DOM element doesn't exist
- Initializing before DOM is ready
- Incorrect selector
Solutions:
-
Verify element exists:
const container = document.getElementById('knidian-container');
console.log(container); // Should not be null -
Initialize after DOM loads:
// Vanilla JS
document.addEventListener('DOMContentLoaded', () => {
const sdk = KnidianSDK.create({ /* ... */ });
});
// React
useEffect(() => {
const sdk = KnidianSDK.create({ /* ... */ });
return () => sdk.destroy();
}, []); -
Check selector syntax:
// ID selector
container: '#knidian-container' // Element with id="knidian-container"
// Class selector
container: '.knidian-container' // Element with class="knidian-container"
// DOM element
container: document.getElementById('knidian-container')
Runtime Issues
SDK Not Displaying Content
Symptoms: SDK initializes but shows blank screen
Causes:
- CSS conflicts
- Z-index issues
- Container size is zero
- Theme configuration issues
Solutions:
-
Check container dimensions:
const container = document.getElementById('knidian-container');
console.log(container.offsetWidth, container.offsetHeight);
// Both should be > 0 -
Set minimum container size:
#knidian-container {
min-height: 600px;
width: 100%;
} -
Check for CSS conflicts:
// Use browser DevTools to inspect elements
// Look for conflicting styles -
Reset to default theme:
const sdk = KnidianSDK.create({
authUrl: 'https://your-backend.com/api/knidian-auth',
userId: 'user-123',
container: '#app'
// Remove theme config to test with defaults
});
Theming Issues
Custom Theme Not Applying
Symptoms: Custom colors/fonts not showing
Causes:
- Invalid color format
- CSS specificity issues
- Caching
Solutions:
-
Verify color format:
theme: {
primaryColor: '#3b82f6' // Must be 6-digit hex
} -
Clear browser cache
-
Inspect element in DevTools to verify styles applied
Getting Help
Before Contacting Support
Gather this information:
- SDK Version:
KnidianSDK.version - Browser: Name and version
- Error Messages: From browser console
- Steps to Reproduce: Detailed steps
- Screenshots: If applicable
- Network Logs: From DevTools Network tab
Contact Support
- General Support: support@knidian.ai
- Technical Issues: support@knidian.ai (include debug info)
- Security Issues: security@knidian.ai
- Licensing: licensing@knidian.ai
Response Times
- Standard support: 24 hours
- Priority support: 4 hours
- Critical issues: 1 hour
Additional Resources
- Configuration Guide: Complete configuration reference
- Security Guide: Security best practices
- Getting Started: Initial setup
- GitHub Issues: Known issues and updates
If your issue isn't listed here, please contact support@knidian.ai with detailed information about your problem.