Building desktop apps with action scheduler to pull data from oauth2 user-agent flow api?

Still trying to figure out Wappler capabilities.

Is it possible to build an Electron desktop app that stores/uses access/refresh tokens for oauth2 user-agent flows within the Electron app?

It looks like AppAuth is the way to go.



Should be possible indeed - you just have to figure the right workflow

Thanks @George. So the action scheduler is a process that runs on the client continuously and will work in Electron apps?

Yes indeed. You can place the Action Scheduler on a page together with the core App Connect framework.

You can choose the time interval and even fully control it with stop, pause and start whenever you want.

1 Like

Will it run if the user is not on the page?

Is it possible/recommended to include this in an ā€œincludeā€ page (e.g. Header file) so itā€™s available on all pages?

Yes, the page should be running in the browser/device. Canā€™t think of a use case where you would need it to run if the content is not displayed?

I do not see any issues running the scheduler inside an include as long as your content that is being ā€˜scheduledā€™ is in the same include file.

Thanks, @brad.

The use case is this: Build a Desktop app with Electron and local storage.

There may be multiple files/tables used in the local storage. Each table would have its own page and it may get its data from a third-party API. I do not want the user to have to wait for the data to be fetched from the API on page load. I want it already stored in the local file(s)/table(s).

Ah, not sure how that would work. Probably best to wait for an answer for George or Teodor. You are getting into territory I an not as familiar with.

Browsers delay or pause JavaScript when the page is not active. So it is possible that it doesnā€™t run when the user is not on the page. The scheduler uses requestAnimationFrame.

Thanks @patrick. It looks like thereā€™s a parameter for this ā€œbackgroundThrottlingā€.

https://electronjs.org/blog/electron-4-0#controlling-webcontents-background-throttling

1 Like

Nice one @kfawcett - you might want to keep track of @WappsGames using Firebase in Wappler as realtime database with Wapplerā€™s API Connector, see

Thanks @George. Iā€™m more inclined to use something like PouchDB and not get locked into Google.

1 Like