Zamok Kiosk API
    Preparing search index...

    Zamok Kiosk API

    Getting Started

    Download zamok.js and include it in your website.

    Example:

    <script src="zamok.js"></script>
    

    Please Note: You must allow your website's domain in the Zamok Dashboard at Settings > Webview > API Origins.

    const zamok = Zamok.api('https://www.mywebsite.com'); // Most websites will use this method
    // or
    const zamok = Zamok.api({ topWindowOrigin: 'https://www.mywebsite.com' }); // for usage in sub frame (iframe)
    // or
    const zamok = Zamok.api({ topWindowOrigin: 'https://www.mywebsite.com', topWindowRef: someWindowObject }); // if the above doesn't work you may need to supply topmost window reference

    The API loads asynchronously. You must wait for .ready before you can request state or dispatch an action.

    zamok.ready
    .then(() => {
    // The API is now ready
    }
    .catch((e)=>console.error)
    type ZamokAction = { type: string; payload?: any };
    type ZamokState = {
    kiosk: {
    kid: string; // kiosk ID
    name: string;
    };
    // many other fields that can vary based on enabled modules
    };
    type ZamokUpdate = { state: ZamokState; action: ZamokAction };

    type GetStateProps = { needProps: string[] };

    Resolves with most recent state.

    An optional parameter can be used to ensure the resolved state already has the properties you need, e.g.

    zamok.getState({ needProps: ['someSolutionSettings'] }).then(({ someSolutionSettings }) => {
    console.log('This is not undefined:', someSolutionSettings);
    });

    Dispatches an action and resolves with updated state

    Waits for Zamok action of specified type.

    If timeoutMs is specified, waits for specified amount of milliseconds and rejects if there's no result to resolve with yet.

    RxJS observable. ZamokUpdate is fired anytime Redux action is fired or state changes. Contains {action: ReduxAction, state: ReduxState }.