# Quick tip: sharing data between mobile plugin elements using globalThis

**URL:** <https://forum.bubble.io/t/quick-tip-sharing-data-between-mobile-plugin-elements-using-globalthis/397606>\
**Category:** Plugin builders\
**Created:** [June 26, 2026, 8:48am UTC](https://forum.bubble.io/t/quick-tip-sharing-data-between-mobile-plugin-elements-using-globalthis/397606 "2026-06-26T08:48:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [June 26, 2026, 8:48am UTC](https://forum.bubble.io/t/quick-tip-sharing-data-between-mobile-plugin-elements-using-globalthis/397606/1 "2026-06-26T08:48:34Z")

</div>

Just a quick tip for anyone looking to share data between multiple elements in a mobile plugin.

With web elements this was never much of a problem, because you can use the global `window` object as a bridge between elements. Mobile elements are a different story, there’s no `window` (or DOM) in the React Native runtime. The good news is there’s an equivalent: the `globalThis` object, which is available in both environments and works the same way as a shared space.

Here’s a quick example of each:

**Web element**

```auto
window.sharedVar = "example shared text";
window.sharedFunc = function () { /* ... */ };

```

**Mobile element**

```auto
globalThis.sharedVar = "example shared text";
globalThis.sharedFunc = function () { /* ... */ };

```

One element writes a value (or a function) onto `globalThis`, and another element can read it. A handy pattern is to have one element register a function on `globalThis` that a second element can call, for example to notify it that some shared data has changed.

Hope it’s useful!

Paul

---

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [June 26, 2026, 9:26am UTC](https://forum.bubble.io/t/quick-tip-sharing-data-between-mobile-plugin-elements-using-globalthis/397606/2 "2026-06-26T09:26:56Z")

</div>

Awesome tip. I’ve been looking at dabbling in some mobile plugins soon and use the window a lot in web plugins.

---

<div class="post-metadata">

**Author:** ![pork1977gm](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pork1977gm/32/245627_2.png) [@pork1977gm](https://forum.bubble.io/u/pork1977gm)\
**Post date:** [June 26, 2026, 10:45am UTC](https://forum.bubble.io/t/quick-tip-sharing-data-between-mobile-plugin-elements-using-globalthis/397606/3 "2026-06-26T10:45:37Z")

</div>

Ah glad it helped!
