( bootURL: string, app: string, cookies?: string, )
| 166 | } |
| 167 | |
| 168 | const fetchBoot = async ( |
| 169 | bootURL: string, |
| 170 | app: string, |
| 171 | cookies?: string, |
| 172 | ): Promise<Boot> => { |
| 173 | // Persisted by the CMP in the euconsent-v2 cookie on a previous page view — |
| 174 | // the CMP script loads after boot fires, so the live __tcfapi is never |
| 175 | // available here. |
| 176 | const res = await fetch(bootURL, { |
| 177 | method: 'GET', |
| 178 | credentials: 'include', |
| 179 | headers: { |
| 180 | app, |
| 181 | 'Content-Type': 'application/json', |
| 182 | ...getStoredConsentHeaders(), |
| 183 | ...(cookies && { Cookie: cookies }), |
| 184 | }, |
| 185 | }); |
| 186 | return res.json(); |
| 187 | }; |
| 188 | |
| 189 | export async function getBootData({ |
| 190 | app, |
no test coverage detected