# Beginner Question: Where is \`publicAPI.getActiveSource\` declared?

**URL:** https://discourse.vtk.org/t/beginner-question-where-is-publicapi-getactivesource-declared/9863
**Category:** Web
**Created:** [November 17, 2022, 1:41pm UTC](https://discourse.vtk.org/t/beginner-question-where-is-publicapi-getactivesource-declared/9863 "2022-11-17T13:41:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![davidshq](https://discourse.vtk.org/user_avatar/discourse.vtk.org/davidshq/32/3553_2.png) [@davidshq](https://discourse.vtk.org/u/davidshq)
#### Post date: [November 17, 2022, 1:41pm UTC](https://discourse.vtk.org/t/beginner-question-where-is-publicapi-getactivesource-declared/9863/1 "2022-11-17T13:41:31Z")

</div>

I can find declarations for most functions in the vtk.js source code. For example, `publicAPI.setActiveSource` is in `/Proxy/Core/ProxyManager/core.js`:

```nohighlight
  publicAPI.setActiveSource = (source) => {
    if (model.activeSource !== source) {
      if (model.activeSourceSubscription) {
        model.activeSourceSubscription.unsubscribe();
        model.activeSourceSubscription = null;
      }
      model.activeSource = source;
      if (source) {
        model.activeSourceSubscription = source.onModified(publicAPI.modified);
      }
      publicAPI.modified();
      publicAPI.invokeActiveSourceChange(source);
    }
  };

```

But when I search for `publicAPI.getActiveSource` I find only usages. For example it is used in `Proxy/Core/ProxyManager/properties.js` in the `publicAPI.getSections` function.

Is it being created dynamically? Any help is appreciated.

Thanks!

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [November 17, 2022, 3:05pm UTC](https://discourse.vtk.org/t/beginner-question-where-is-publicapi-getactivesource-declared/9863/2 "2022-11-17T15:05:30Z")

</div>

Yes, it’s created dynamically here: [vtk-js/index.js at master · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/blob/master/Sources/Proxy/Core/ProxyManager/index.js#L31). The `setGet` function generates a setter and getter for a given list of properties.
