Skip to content

GCP.RecaptchaEnterprise reference

Source: src/GCP/RecaptchaEnterprise/CreateAssessment.ts

Runtime binding for reCAPTCHA Enterprise assessments.create.

Bind this operation to a Key in a Function/Action init phase. Provide CreateAssessmentHttp. The key’s site key is filled in on event.siteKey when omitted.

const createAssessment = yield* GCP.RecaptchaEnterprise.CreateAssessment(
key,
);
const assessment = yield* createAssessment({
body: {
event: {
token: recaptchaToken,
expectedAction: "login",
},
},
});

Source: src/GCP/RecaptchaEnterprise/CreateAssessmentHttp.ts Kind: Layer · Provides: GCP.RecaptchaEnterprise.CreateAssessment

HTTP implementation of CreateAssessment.

Source: src/GCP/RecaptchaEnterprise/Firewallpolicy.ts

A reCAPTCHA Enterprise firewall policy.

Policies have no labels field and a server-assigned id, so only a recorded policy can be read back. The policy id is assigned by Google — changing firewallpolicyId replaces the policy. Path, description, condition, and actions update in place.

Allow a login path

const policy = yield* GCP.RecaptchaEnterprise.Firewallpolicy("Login", {
path: "/login",
description: "allow login",
actions: [{ allow: {} }],
});

Block with a CEL condition

const policy = yield* GCP.RecaptchaEnterprise.Firewallpolicy("Bot", {
path: "/checkout",
condition: "true",
actions: [{ block: {} }],
});
// Same logical id as before; only the changed props differ.
const policy = yield* GCP.RecaptchaEnterprise.Firewallpolicy("Login", {
path: "/signin",
description: "allow sign-in",
actions: [{ allow: {} }],
});

Source: src/GCP/RecaptchaEnterprise/Key.ts

A reCAPTCHA Enterprise key.

Key ids are assigned by Google and are the site key used by client libraries. Alchemy stamps ownership into labels so list / nuke can find them. Display name, labels, and allowed domains update in place. Changing keyId, platform kind (web / Android / iOS / Express), webSettings.integrationType, AMP traffic, WAF settings, or testing options replaces the key.

Generated SCORE web key

const key = yield* GCP.RecaptchaEnterprise.Key("Signup", {});

Named SCORE key with labels and a test score

const key = yield* GCP.RecaptchaEnterprise.Key("Signup", {
displayName: "signup form",
labels: { env: "prod" },
testingOptions: { testingScore: 0.9 },
webSettings: {
integrationType: "SCORE",
allowAllDomains: true,
},
});
const createAssessment = yield* GCP.RecaptchaEnterprise.CreateAssessment(
key,
);
const assessment = yield* createAssessment({
body: {
event: { token: recaptchaToken, expectedAction: "login" },
},
});