Installation

We made getting set up with the Loginhood JavaScript SDK as easy as possible.

Installing your JavaScript SDK

Place a new script tag between the <head> ... </head> elements of your website. This script will load asynchronously when your site loads, ensuring that the page is not blocked while the Consent Manager loads.

Our script size delivers at ~52kb gzipped, causing little to no overhead on your site visitors. This script loads the given configuration file for your consent manager, which generally ranges from 1kb to 25kb in size. After loading these the first time, the browser will cache them and load instantly thereafter.

To ensure our script loads as fast as possible, we recommend adding a preconnect link to our CDN.

Loginhood uses a unique api key along with cm_id (Consent Manager id) for each website, so that we can reference your appropriate site configurations.

Add the preconnect link and script like so:

<head>
...
<link rel="preconnect" href="https://cdn.loginhood.io">
<script src="https://cdn.loginhood.io/v1.2/log-cmp.js?api=<<api_key>>&cm_id=<<cm_id>>"></script>
...
</head>

When you have this test page live please email support@loginhood.io. We will work with you to confirm the setup is correct, before code changes are made in a production environment.