@zappahq/core
v1.0.32
Published
Core SDK for Zappa
Downloads
6
Readme
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>