Initialize SDK


interface Configuration {
  serviceIdentifier: string;
  displayMode: AgeGateDisplayMode;

type AgeGateDisplayMode = "popup" | "redirect";

The method initiates AgeGate SDK.

Redirect mode implies sending users to a different URL from the one they originally requested. Popup mode implies displaying via a popup browser window that is displayed on top of the existing windows on the screen.

These modes will take place only in case Privo needs to collect some data from the user (for example birth date). Details

Age Gate init entry parameters:

serviceIdentifier - service identifier

displayMode - widget display mode configurations: "popup","redirect"

JS (Typescript) Age Gate SDK location (use it as a script src for SDK uploading):

Development Environment:

Development Environment (Typescript types):

Production Environment:

Production Environment (Typescript types):

After initialization you can set up onStatusChange callback. See doc


<!DOCTYPE html>
  <title>Age Gate load Demo</title>
  <script src=""></script>
    window.onload = async () => {
          serviceIdentifier: "your_identifier",
          displayMode: "redirect"
      const response = await privo.ageGate.getStatus("user-identifier");