Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main(projectNumber) {
// Create the reCAPTCHA client library.
const {
RecaptchaEnterpriseServiceV1Beta1Client,
} = require('@google-cloud/recaptcha-enterprise');
const client = new RecaptchaEnterpriseServiceV1Beta1Client();
// format the path to the project (it should be prefaced with projects/).
const formattedParent = client.projectPath(projectNumber);
// assessment should contain event with RESPONSE_TOKEN and RECAPTCHA_SITE_KEY:
// "{'event': {'token': 'RESPONSE_TOKEN', 'siteKey': 'RECAPTCHA_SITE_KEY'}}"
const assessment = {};
const request = {
parent: formattedParent,
assessment: assessment,
};
await client.createAssessment(request);
}
// [END recaptcha_enterprise_quickstart]
function main() {
const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client();
}