Integrate Paskod AntiBot into your website in less than 5 minutes.
1. Get your API Key
First, navigate to the Dashboard and create a new site. You will be provided with an `api_key`. This key is required to initialize the widget and verify tokens on your server.
2. Include the JS Widget
Add the following script tag to the <head> or before the closing </body> tag of your HTML.
<script src="https://paskod.tgdt.ru/widget.js"></script>
3. Render the Widget
Create an empty <div> in your form where you want the AntiBot verification to appear. Then, call the render method.
<form id="my-form" action="/submit" method="POST">
<input type="email" name="email" placeholder="Enter email" />
<!-- AntiBot Container -->
<div id="captcha"></div>
<input type="hidden" name="antibot_token" id="antibot_token" />
<button type="submit">Submit</button>
</form>
<script>
PaskodAntiBot.render("#captcha", {
siteKey: "YOUR_API_KEY",
action: "signup",
onSuccess: function(token) {
document.getElementById('antibot_token').value = token;
}
});
</script>
4. Verify on your Backend
When the form is submitted, your backend should extract the `antibot_token` and verify it by making a POST request to our API. Do not trust the token without server-side verification!
// Node.js Express Example
app.post('/submit', async (req, res) => {
const token = req.body.antibot_token;
// Verify the token by calling the Paskod AntiBot API
const response = await fetch("https://paskod.tgdt.ru/api/verify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ token })
});
const data = await response.json();
if (data.result === 'passed') {
// Proceed with action
res.send("Success!");
} else {
res.status(403).send("Bot detected!");
}
});