GCP.RecaptchaEnterprise reference
CreateAssessment
Section titled “CreateAssessment”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.
CreateAssessment: Creating an Assessment
Section titled “CreateAssessment: Creating an Assessment”const createAssessment = yield* GCP.RecaptchaEnterprise.CreateAssessment( key,);const assessment = yield* createAssessment({ body: { event: { token: recaptchaToken, expectedAction: "login", }, },});CreateAssessmentHttp
Section titled “CreateAssessmentHttp”Source:
src/GCP/RecaptchaEnterprise/CreateAssessmentHttp.tsKind: Layer · Provides:GCP.RecaptchaEnterprise.CreateAssessment
HTTP implementation of CreateAssessment.
Firewallpolicy
Section titled “Firewallpolicy”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.
Firewallpolicy: Creating a Policy
Section titled “Firewallpolicy: Creating a Policy”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: {} }],});Firewallpolicy: Updating a Policy
Section titled “Firewallpolicy: Updating a Policy”// 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.
Key: Creating a Key
Section titled “Key: Creating a 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, },});Key: Assessments
Section titled “Key: Assessments”const createAssessment = yield* GCP.RecaptchaEnterprise.CreateAssessment( key,);const assessment = yield* createAssessment({ body: { event: { token: recaptchaToken, expectedAction: "login" }, },});