UNPKG

@nsmp/js-api

Version:

Types for jsApi

12 lines (9 loc) 257 B
export const getJsApiContext = (environment, getContext) => { if (environment === 'ui' && getContext) { return getContext() || window.uiFrameApiContext; } if (environment === 'uiFrame') { return window.parent.uiFrameApiContext; } return null; };