scm-spain / boros-CMP

GDPR CMP (Consent Managment Provider) implementation
MIT License
5 stars 1 forks source link

Make cmp-boros importable from server-side #61

Closed midudev closed 5 years ago

midudev commented 5 years ago

Background

Library is not compatible with server-side rendering as it's using window freely while it could be not defined.

Goal

Make the library importable from server in order to try to import it as soon as possible, in the same chunk as the principal bundle.

Implementation

Use safe check against window being undefined.

Further considerations

All the functionality remains the same.

Visual Description

image