# twitch.ext.configuration.onChange not called on configuration change

**URL:** <https://discuss.dev.twitch.com/t/twitch-ext-configuration-onchange-not-called-on-configuration-change/27156>\
**Category:** Extensions\
**Created:** [July 16, 2020, 2:43pm UTC](https://discuss.dev.twitch.com/t/twitch-ext-configuration-onchange-not-called-on-configuration-change/27156 "2020-07-16T14:43:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slawus](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/slawus/32/5599_2.png) [@slawus](https://discuss.dev.twitch.com/u/slawus)\
**Post date:** [July 16, 2020, 2:43pm UTC](https://discuss.dev.twitch.com/t/twitch-ext-configuration-onchange-not-called-on-configuration-change/27156/1 "2020-07-16T14:43:08Z")

</div>

Hi

I’ve an issue with Configuration Service. I have a backend service that updates twitch configuration using twitch API endpoint (`PUT https://api.twitch.tv/extensions/<client ID>/configurations`). It’s using “broadcaster” segment. The problem is that extension doesn’t get information about configuration getting updated. I’m using `twitch.ext.configuration.onChange(callback)`, but my callback is called just once, right after extension load. Any changes of the configuration doesn’t refire it.

The extension is in “Hosted test” mode.

Does anyone run into such problem?

Thanks.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 16, 2020, 2:56pm UTC](https://discuss.dev.twitch.com/t/twitch-ext-configuration-onchange-not-called-on-configuration-change/27156/2 "2020-07-16T14:56:43Z")

</div>

> [@slawus](#):
>
> I’m using `twitch.ext.configuration.onChange(callback)` , but my callback is called just once, right after extension load. Any changes of the configuration doesn’t refire it.

Correct. It only fires ONCE at extension load up

You probably want to do something like this:

> <https://github.com/BarryCarlyon/twitch_misc/tree/main/extensions/config_service>
>
> //github.com/BarryCarlyon/twitch\_misc/tree/main/extensions/config\_service

When you send a Config Update, you also broadcast the update over PubSub.

onChanged only fires once at extension boot up.  
So running instances of your extension either need to reload the page, or be sent the update config via PubSub

---

<div class="post-metadata">

**Author:** ![slawus](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/slawus/32/5599_2.png) [@slawus](https://discuss.dev.twitch.com/u/slawus)\
**Post date:** [July 16, 2020, 3:03pm UTC](https://discuss.dev.twitch.com/t/twitch-ext-configuration-onchange-not-called-on-configuration-change/27156/3 "2020-07-16T15:03:46Z")

</div>

Ok. So the method name is super misleading. `onChange` suggest that it actually react to changes. `onLoad` would be much better name.

BTW its super weird design choice made by Twitch dev team to not broadcasting configuration changes by default. In 99% of cases extensions need to have up-to-date configuration, which means in 99% of cases developers’ll have to use Pub/Sub anyway and implement this by their own.

Thanks for the reply.
