/* eslint-env browser */ const getSourceForFrame = ( serviceUrl: string, path: string, referrer: string, callback: (data: any) => void, ) => { const getSource = async (): Promise => { const url = `${serviceUrl}?path=${path}&referrer=${referrer}`; const response = await fetch(url, { credentials: 'include', }); const json = await response.json(); callback(json); }; getSource(); }; export default getSourceForFrame;