# How to use api.onPageChange with api.createWidget?

**URL:** https://meta.discourse.org/t/how-to-use-api-onpagechange-with-api-createwidget/242744
**Category:** Development
**Tags:** ember
**Created:** [October 24, 2022, 2:55am UTC](https://meta.discourse.org/t/how-to-use-api-onpagechange-with-api-createwidget/242744 "2022-10-24T02:55:24Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [October 25, 2022, 7:04pm UTC](https://meta.discourse.org/t/how-to-use-api-onpagechange-with-api-createwidget/242744/7 "2022-10-25T19:04:03Z")

</div>

It’s a little more complicated than that to translate to a locally installed theme component, but one way to add some flexibility to a remote theme would be using theme settings ([Add settings to your Discourse theme](https://meta.discourse.org/t/add-settings-to-your-discourse-theme/82557)).

That involves adding a [settings.yml](https://github.com/awesomerobot/discourse-component-example/blob/main/settings.yml) file and updating a few values in the component and/or template. Then you get settings on your theme component admin page like this:

 ![Screen Shot 2022-10-25 at 2.56.54 PM](https://global.discourse-cdn.com/meta/original/4X/8/1/8/818e6881ef1a6ff6ec83303d1514677bb109f9e6.png)

It’s also fine to stick with the widget implementation above and update via the admin panel, but we tend to recommend using git when possible; it’s easier to share if you need to troubleshoot, and it makes it easy to track your changes.

---

_[View the full topic](https://meta.discourse.org/t/how-to-use-api-onpagechange-with-api-createwidget/242744)._
