Skip to content

Web SDK

The Community Hub Web SDK (ChWebSdk) is a JavaScript API exposed on community pages. It lets you search content, manage users, subscribe to topics and categories, and interact with the DOM from custom widgets or third-party scripts running in the community frontend.

The SDK is browser-only: all methods that call the backend or DOM throw if run outside a browser environment.

Availability

The SDK is bundled with the community frontend and attached to window (or globalThis) when the destination app loads. There is no separate npm package; you use the global ChWebSdk object on pages that include the community bundle.

javascript
// After the community app has loaded
ChWebSdk.onReady(() => {
  console.log('SDK ready')
})

Quick start

javascript
ChWebSdk.onReady(async () => {
  const results = await ChWebSdk.Content.search('feature request', { limit: 10 })
  console.log(results)
})

See Examples for more runnable snippets covering search, subscriptions, users, and DOM interactions.

Summary

Next Steps

Gainsight CC Developer Portal