Menu
Install
Install with the setup script
Build and review a release yourself, or attach World ID to a website that CloudFormation, CDK or Terraform manages.
When to use the setup script
Both paths deploy the same CloudFormation template, and neither needs CDK bootstrap.
| Path | Use it when | Code source |
|---|---|---|
| Launch from the setup page | You manage your distribution and Web ACL in the console. | World's published release, pinned by digest |
| Setup script | You want to build and review the code yourself, or infrastructure code owns the website. | Your own build of a release checkout |
You need a checkout of the World ID Bot Prevention release, the Node.js and pnpm versions that it names in .node-version and package.json, and AWS CLI v2 signed in to the subscribed account.
Install
Prepare the signing key and World ID app
Complete steps 1 to 5 of Subscribe and install.
Keep your installation ID, app ID and RP ID
The installation ID is in your registration email. The script passes all three to the same template that the setup page launches.
Run the setup script
From the root of the release checkout:
Terminal
pnpm install --frozen-lockfile pnpm customer:setup init --installation <installation ID> --app-id <app_…> --rp-id <rp_…> --out .wid/customer.json pnpm customer:setup plan --config .wid/customer.json pnpm customer:setup apply --config .wid/customer.json pnpm customer:setup check --config .wid/customer.json
| Command | What it does |
|---|---|
init | Asks for the settings that CloudFormation asks for and saves a configuration file without secrets. It reads the Web ACL from the distribution. |
plan | Builds the release, uploads it to a private bucket in your account, checks the KMS key and creates a change set. It refuses changes that would replace your keys or replay state. |
apply | Deploys the change set and follows the stack events. On failure, it prints the first failing resource. |
check | Shows the stack, its version and recent failures, and probes the routes on every hostname. |
Other settings start at their defaults. Edit them in .wid/customer.json before plan. See the settings reference.
Websites managed by infrastructure code
When CloudFormation, CDK or Terraform owns your distribution and Web ACL, keep them there. In init, choose the resources-only attachment mode. The stack then creates the World ID resources, but does not change CloudFront or AWS WAF. You cannot change the attachment mode of an existing installation.
Deploy the resources
Run
plan,applyandcheckas above.Export the attachment
Terminal
pnpm customer:setup attachment --config .wid/customer.json --out .wid/attachment.jsonThe export reads your AWS configuration and changes nothing. It contains resource identifiers, not keys.
Merge it into your website stack
Add the two origins and the two
/__wid/*cache behaviors before your behaviors, the session check function association on every application behavior, and the two AWS WAF rules after the rules of your Web ACL. The fields use the shape of the CloudFormationAWS::CloudFront::DistributionandAWS::WAFv2::WebACLproperties. Map them to CDK or Terraform the same way.Deploy and check
Deploy your website stack through its normal pipeline, then run
check. Your deployment diff must modify the existing distribution and Web ACL, not replace them.