Initialize Age Estimation SDK

Installation via NPM:

npm install privo-age-estimation-sdk

Installation via CDN:

Integration Environment:
https://age-int.privo.com/estimation/privo.min.js

Development Environment (Typescript types):
https://age-int.privo.com/estimation/privo.d.ts


Production Environment:
https://age.privo.com/estimation/privo.min.js

Production Environment (Typescript types):
https://age.privo.com/estimation/privo.d.ts


Example:
<script src="https://age.privo.com/estimation/privo.min.js"></script>

Initialization (via NPM):

  import { init } from "privo-age-estimation-sdk";

  await init(config) 

Initialization (via CDN):

  privo.ageEstimation.init(config)

  interface PartnerConfiguration {
    env: "int" | "prod";
    serviceIdentifier: string;
  }  

Age Estimation init entry parameters:

env - type of the PRIVO environment: int - for integration testing, prod - for real users
serviceIdentifier - service identifier provided by Privo.

Note: Before real usage please send an email request to devops@privo.com to whitelist your site origin in the PRIVO CORS settings.

After initialization you can set up onStatusChange callback. See doc

Example (CDN):

<!DOCTYPE html>
<html>
<head>
  <title>Age Gate load Demo</title>
  <script src="https://age.privo.com/estimation/privo.min.js"></script>
  <script>
    window.onload = async () => {
      privo.ageEstimation.init({
          env: "prod",
          serviceIdentifier: "your_identifier",
      });
    }
  </script>
</head>
<body>
</body>
</html>

Example (NPM):

import { init } from "privo-age-estimation-sdk";

await init({
  env: "prod",
  serviceIdentifier: "your_identifier",
})