# Capture When Session Has Loaded

**URL:** <https://forum.inductiveautomation.com/t/capture-when-session-has-loaded/106902>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [June 2, 2025, 3:48pm UTC](https://forum.inductiveautomation.com/t/capture-when-session-has-loaded/106902 "2025-06-02T15:48:53Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 4, 2025, 2:59pm UTC](https://forum.inductiveautomation.com/t/capture-when-session-has-loaded/106902/3 "2025-06-04T14:59:51Z")

</div>

> [@Derek\_Reees](#):
>
> toast notification system

I'd highly recommend you check out @bmusson 's module which integrates toastify:

> [@Musson Industrial's Embr-Periscope Module](https://forum.inductiveautomation.com/t/musson-industrials-embr-periscope-module/99047/23):
>
> The Toasts Update [Periscope version 0.7.0](https://github.com/mussonindustrial/embr/releases/tag/%40embr-modules%2Fperiscope%400.7.0) includes toasts powered by [react-toastify](https://github.com/fkhadra/react-toastify). The toasts also work in the designer wink. Creating a Toast These are client-side toasts, therefore all the interaction is done via [system.perspective.runJavaScriptAsync](https://docs.mussonindustrial.com/ignition/embr-periscope/scripting/perspective/system-perspective-runJavaScriptAsync). periscope.toast is directly mapped to react-toastify's toast object, all features are supported. Simplest Example system.perspective.runJavaScriptAsync('''() =\> { periscope.toast('Your first toast!') }''') Embedded View To…

If it helps, I wrote this small libarary with a function to call the toast notification:

```python
# LIBRARY: shared.fe.perspective.toast
class ToastType:
	INFO = 'info'
	SUCCESS = 'success'
	WARNING = 'warning'
	ERROR = 'error'

def showToast(content, toastType=ToastType.INFO, autoClose=5000):
	"""
	Shows a toast notification to the user.
	Required Modules:
		Embr-Periscope
	
	"""
	args = {
		'content': content,
		'options': {
			  "autoClose": 5000,
			  "closeButton": True,
			  "closeOnClick": False,
			  "draggable": True,
			  "hideProgressBar": False,
			  "icon": True,
			  "pauseOnFocusLoss": False,
			  "pauseOnHover": True,
			  "position": "bottom-center",
			  "theme": "colored",
			  "type": toastType
			}
		}
	system.perspective.runJavaScriptAsync('''(content, options) => {		
		periscope.toast(content, options)
	}''', args)

```

Call it like this:

```python
shared.fe.perspective.toast.showToast('Hello!', shared.fe.perspective.toast.ToastType.SUCESS)

```

_Note: "fe" stands for FrontEnd, if you are wondering_

---

_[View the full topic](https://forum.inductiveautomation.com/t/capture-when-session-has-loaded/106902)._
