

// https://github.com/ZennoLab/capmonstercloud-client-js
// Turnstile 1 without proxy
import { CapMonsterCloudClientFactory, ClientOptions, TurnstileRequest } from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: '<your capmonster.cloud API key>' }) // Your CapMonster Cloud API key
);
console.log(await cmcClient.getBalance());
const turnstileRequest = new TurnstileRequest({
websiteURL: 'http://tsmanaged.zlsupport.com', // Page URL with captcha
websiteKey: '0x4AAAAAAABUYP0XeMJF0xoy', // Replace with correct value
});
// Turnstile 1 with proxy
/*
const turnstileRequest = new TurnstileRequest({
websiteURL: 'http://tsmanaged.zlsupport.com',
websiteKey: '0x4AAAAAAABUYP0XeMJF0xoy',
proxyType: 'https',
proxyAddress: '8.8.8.8',
proxyPort: 8080,
proxyLogin: 'proxyLogin',
proxyPassword: 'proxyPassword',
})
*/
console.log(await cmcClient.Solve(turnstileRequest));
});
// Cloudflare Challenge token
import { CapMonsterCloudClientFactory, ClientOptions, TurnstileRequest } from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: '<your capmonster.cloud API key>' })
);
console.log(await cmcClient.getBalance());
const turnstileRequest = new TurnstileRequest({
websiteURL: 'https://example.com', // Page URL with captcha
websiteKey: '0x4AAAAAAABUYP0XeMJF0xoy', // Replace with correct value
data: 'YOUR_DATA_HERE',
pageAction: 'managed',
cloudflareTaskType: 'token',
pageData: 'YOUR_PAGE_DATA_HERE',
userAgent: 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)',
});
// Example with proxy (uncomment if needed)
/*
const turnstileRequest = new TurnstileRequest({
websiteURL: 'https://example.com',
websiteKey: '0x4AAAAAAABUYP0XeMJF0xoy',
data: 'YOUR_DATA_HERE',
pageAction: 'managed',
cloudflareTaskType: 'token',
pageData: 'YOUR_PAGE_DATA_HERE',
userAgent: 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)',
// Proxy settings
proxyType: 'http',
proxyAddress: '123.45.67.89',
proxyPort: 8080,
proxyLogin: 'username',
proxyPassword: 'password'
});
*/
console.log(await cmcClient.Solve(turnstileRequest));
});
// Cloudflare Challenge cf_clearance
import { CapMonsterCloudClientFactory, ClientOptions, TurnstileRequest } from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: '<your capmonster.cloud API key>' })
);
console.log(await cmcClient.getBalance());
const turnstileRequest = new TurnstileRequest({
websiteURL: 'https://tsinvisble.zlsupport.com', // Page URL with captcha
websiteKey: '0x4AAAAAAABUY0VLtOUMAHxE', // Replace with correct value
cloudflareTaskType: 'cf_clearance',
proxyType: 'http',
proxyAddress: '8.8.8.8',
proxyPort: 8080,
proxyLogin: 'proxyLoginHere',
proxyPassword: 'proxyPasswordHere',
htmlPageBase64: 'htmlPageBase64Here',
userAgent: 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)'
});
console.log(await cmcClient.Solve(turnstileRequest));
});