Appearance
Are you an LLM? You can read better optimized documentation at /docs/sdk/widget-sdk/overview.md for this page in Markdown format
Widget SDK
The SDK is a JavaScript library that your widget code uses to call connectors — the secure backend proxies that connect widgets to external APIs. Instead of making API calls directly from the browser (which would expose your credentials), you use the SDK to route requests through the platform.
The SDK is loaded automatically by Customer Community and exposed on window.WidgetServiceSDK inside every widget — no script tag is required. Use it like this:
html
<script>
// Async IIFE required — top-level await is not available in plain <script> tags
(async () => {
const sdk = new window.WidgetServiceSDK();
const data = await sdk.connectors.execute({
permalink: "weather-api",
method: "GET",
queryParams: { q: "Warsaw" }
});
console.log(data);
})();
</script>1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Constructor options
Pass an optional configuration object when creating the SDK instance:
javascript
const sdk = new window.WidgetServiceSDK({
timeout: 15000,
headers: { "X-Custom-Header": "value" }
});1
2
3
4
2
3
4
| Option | Type | Default | Description |
|---|---|---|---|
headers | Record<string, string> | {} | Headers included with every request |
timeout | number | 30000 | Request timeout in milliseconds |
Next Steps
- API Reference — full method signatures and error handling
- Examples — real-world usage patterns
- Configuration — set up connectors to call with the SDK

