@zappahq/core
TypeScript icon, indicating that this package has built-in type declarations

1.0.32 • Public • Published

Zappa Protect

npm (scoped) npm bundle size (scoped) Libraries.io dependency status for latest release, scoped npm package Snyk Vulnerabilities for npm scoped package jsDelivr hits (npm scoped)

Zappa Core SDK

What is this repository for?

  • Provides core functionality for Zappa including:
    • Device Print
    • Adblock Detection

Usage

React

import { Client } from "@usezappa/core";
const siteKey = "SOME_SITE_KEY";

// Initialize the client with your site key
const zpClient = new Client(siteKey);

// DevicePrint
zpClient
  .GetDevicePrint()
  .then((result) => {
    console.log(result);
  })
  .catch((err) => {
    console.error(err);
  });

// Adblock Enabled?
zpClient
  .GetAdblockDetect()
  .then((res) => {
    console.log(result);
  })
  .catch((err) => {
    console.error(err);
  });

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Zappa Core SDK Test</title>
    <script src="../../dist/index.umd.js" crossorigin></script>
    <script type="module">
      const zpClient = new ZPCore.Client("test");
      zpClient
        .GetDevicePrint(true)
        .then((result) => {
          console.log("Result: ", result);
          let doc = document.getElementById("testdiv");
          doc.innerHTML = "Retrieved data - " + JSON.stringify(result, null, 2);
        })
        .catch((error) => {
          console.error("Error: ", error);
        });
    </script>
  </head>

  <body>
    <h1>Testing Zappa Core SDK</h1>
    <div id="testdiv">Loading</div>
  </body>
</html>

Readme

Keywords

none

Package Sidebar

Install

npm i @zappahq/core

Weekly Downloads

3

Version

1.0.32

License

MIT

Unpacked Size

69.9 kB

Total Files

98

Last publish

Collaborators

  • dlepe-tla
  • jcorbello-tla