> ## Documentation Index
> Fetch the complete documentation index at: https://docs.centaur.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Follow your page's asset

> One feed that switches asset as your visitor browses.

Your router calls `onAssetPageChange(id)` on every asset page. The first call mounts the feed; later calls switch the asset in place. Call `onLeaveAssetPages()` before the router removes the container.

```html theme={null}
<div id="centaur-feed"></div>

<script src="https://widgets.centaur.io/v1/sdk.js" crossorigin="anonymous"></script>

<script>
  let widget = null;

  function onAssetPageChange(assetId) {
    const selection = { assetIds: [assetId] };

    if (widget) {
      widget.update({ selection });
    } else {
      widget = CentaurWidgets.v1.mount(document.getElementById('centaur-feed'), {
        kind: 'feed',
        mode: 'live',
        widgetId: 'YOUR_WIDGET_ID',
        selection,
      });
    }
  }

  function onLeaveAssetPages() {
    widget?.destroy();
    widget = null;
  }

  onAssetPageChange(1); // The page the visitor opened.
  // onAssetPageChange(10); // Your router supplies the next page's asset ID.
</script>
```

`update` replaces the whole selection. Pass `{ selection: {} }` to go back to the general feed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.