Nightingale Posing Mischievously

    @onirix/embed-sdk

    1.2.0 • Public • Published

    Onirix Embed SDK

    This library acts as a wrapper of window.postMessage for simplifying communication with Onirix iframes.

    Full documentation available at Onirix Docs.

    Usage

    Using a bundler (Webpack, Rollup):

    1. Install the dependency:
    npm install @onirix/embed-sdk
    
    1. Import and use it within your code:
    const iframeElement = document.findElementById("<iframe_element_id>");
    const embedSDK = new OnirixEmbedSDK(iframeElement);
    
    embedSDK.connect().then(() => {
    
        // Ready to subscribe to events and/or execute actions
    
    });
    

    Using plain HTML

    1. Include the dependency within the HTML head tag:
    <head>
    ...
        <script src="https://unpkg.com/@onirix/embed-sdk@1.1.0/dist/ox-embed-sdk.umd.js">
    ...
    </head>
    
    1. Use it from any other script:
    <script>
    
        const iframeElement = document.findElementById("<iframe_element_id>");
        const embedSDK = new OnirixEmbedSDK(iframeElement);
    
        embedSDK.connect().then(() => {
    
            // Ready to subscribe to events and/or execute actions
    
        });
    
    </script>
    

    Keywords

    none

    Install

    npm i @onirix/embed-sdk

    DownloadsWeekly Downloads

    3

    Version

    1.2.0

    License

    Propietary

    Unpacked Size

    56.5 kB

    Total Files

    11

    Last publish

    Collaborators

    • onirix