Legacy Dev Forum Posts

 View Only

Sign Up

Framework.js as module for import to work?

  • 1.  Framework.js as module for import to work?

    Posted 06-05-2025 19:01

    Barbara_Post | 2022-04-28 09:52:55 UTC | #1

    Hello, what's the proper way to make callbacks I define in framework.js communicate with my own project?

    I thought I could use my app's VueJS event bus feature ( Using event bus in Vue.js to pass data between components - LogRocket Blog

    Basically, a VueJS instance is created and can emit and receive events anywhere in my application.

    Thus, I would need this in framework.js:

    import Vue from 'vue'

    window.Framework = { config: { // ... my config },

    initialSetup: function () { window.PureCloud.subscribe([ { type: "Interaction", categories: ["connect", "disconnect", "change"], callback: function (category, data) { // ... some conditions // use the Vue event bus and send a message with data from received interaction

    Vue.prototype.$inMemoryEventsHub.$emit('genesys-interaction-received', {id: data.new.id, phoneNumber: data.new.phone, startTime: data.new.startTime, language: data.new.attributes.language, zipCode: data.new.attributes.zipCode, queueName: data.new.queueName}) } } }, ...

    Is it possible to make it work? It seems that using (private cloud hosted) framework.js as "script type='module'" would solve it. Thanks for guidance.


    Barbara_Post | 2022-04-28 11:45:48 UTC | #2

    Helping myself, window.postMessage() is the way to go.


    system | 2022-05-28 11:45:53 UTC | #3

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 14497