Back to features
For developers

Complete developer API

Integrate Consentio into your tech stack. Client-side JavaScript API, server-side REST API, real-time events.

Consentio API
Consentio.hasConsent(category)boolean

Checks if a category is consented

Consentio.getConsent()ConsentState

Returns the full consent state

Consentio.on(event, cb)() => void

Listens for consent events

Consentio.reset()void

Resets the visitor's consent

Consentio.show()void

Manually displays the banner

Client-side JavaScript API

Interact with your visitors' consent directly from your JavaScript code. Check consent, listen for changes, reset choices.

Event lifecycle
"ready"

Configuration loaded, widget ready

"show"

Banner displayed to visitor

"consent"

Visitor has made their choice

"hide"

Banner hidden after choice

Consentio.on("consent", (state) => {
// Analytics accepted?
if (state.analytics) {
loadAnalytics();
}
});

Real-time events

Consentio emits JavaScript events at every stage of the consent lifecycle. Ideal for triggering conditional actions in your application.

Installation
<!-- 1 line in your HTML -->
<script src="https://cdn.consentio.ch/widget.js"
data-domain-id="your-id"
async></script>
asyncZero impact on page load

Simple integration

A single line of code in your HTML is all it takes. The widget auto-initializes and exposes its API on the global Consentio object.

  • Async script, zero performance impact
  • Auto-initialization via data-domain-id
  • Compatible with all frameworks (React, Vue, Angular, etc.)

100% Swiss hosting

All data is processed and stored in Switzerland by Infomaniak, in ISO 27001 certified data centers. No data leaves Swiss territory.

Ready to simplify your compliance?

Install Consentio in 5 minutes and ensure nLPD/GDPR compliance for your website.