Skip to main content

Developer Overview

The Biskoui JavaScript SDK provides comprehensive tools for managing user consent and controlling third-party services on your website. This developer section covers everything you need to integrate Biskoui programmatically.

What's Covered

JavaScript SDK

The core SDK provides a synchronous API for managing consent and service activation. Key features include:

  • Global API methods for showing/hiding banners, accepting/rejecting consent
  • Service activation events that fire when users grant consent to specific services
  • Consent checking to query current user permissions
  • Immediate availability after SDK loads with no async complexity

Script Blocking

Automatic script execution based on user consent using simple HTML attributes:

  • Declarative approach - mark scripts with type="text/plain" and data-biskoui attributes
  • Automatic execution when corresponding services are activated
  • Zero JavaScript required for basic integrations
  • Support for all major services like Google Analytics, Facebook Pixel, YouTube, etc.

API Reference

Complete documentation of all methods, events, and data structures:

  • Method signatures with parameters and return values
  • Event specifications including timing and event details
  • Service key formats and naming conventions
  • Common integration examples for popular services

Quick Integration Patterns

Programmatic Control:

// Check consent status
if (biskoui.hasAcceptedService('google_analytics')) {
initAnalytics();
}

// Listen for consent changes
window.addEventListener('biskoui:google_analytics_activated', initAnalytics);

Automatic Script Execution:

<script type="text/plain" data-biskoui="google_analytics">
gtag('config', 'GA_MEASUREMENT_ID');
</script>

Service Management

All integrations use consistent service keys in snake_case format (e.g., google_analytics, youtube) that must match across:

  • Dashboard service configuration
  • API method calls
  • Event names
  • Script blocking attributes

This ensures seamless coordination between consent collection and service activation across your entire website.