🔗 UI SDK + Search SDK Integration Test
Checking SDK availability...
Integration Test: This page demonstrates how a UI SDK would detect
and use the Search SDK when both are loaded via CDN.
SDK Detection
Integration Test
'
);
}
// Run detection
const detection = detectSearchSDK();
const statusEl = document.getElementById('status');
const detectionEl = document.getElementById('detection-results');
const integrationEl = document.getElementById('integration-test');
if (detection.available) {
statusEl.className = 'status success';
statusEl.textContent = '✅ Search SDK detected and ready!';
// Show detection results
detectionEl.innerHTML = `
✅ Integration Successful!
UI SDK can access SeekoraClient from window.SeekoraSDK
Example usage:
const { SeekoraClient } = window.SeekoraSDK;
const client = new SeekoraClient({
storeId: 'your-store-id',
readSecret: 'your-read-secret',
environment: 'stage'
});
const results = await client.search('laptop');
`;
} else {
throw new Error('SeekoraClient is not a function');
}
} catch (error) {
integrationEl.innerHTML = `
Error: window.SeekoraSDK is undefined
Solution: Ensure the Search SDK script is loaded before the UI SDK:
<script src="https://cdn.seekora.com/v0.1.0/seekora-sdk.min.js"></script>
<script src="https://cdn.seekora.com/v0.1.0/seekora-ui.min.js"></script>
`;
}
// Expose helper function for UI SDK developers
window.SeekoraSDKHelpers = {
detectSearchSDK,
getSeekoraClient,
isAvailable: () => typeof window.SeekoraSDK !== 'undefined'
};