The Worldcoin Developer Portal provides tools to interact with the World ID Protocol. Along with IDKit, it's the fastest way to get started with proof of personhood 🚀
All the technical docs for the Worldcoin SDK, World ID Protocol, examples, guides can be found at https://docs.worldcoin.org/
The Developer Portal uses some external services to operate. You do not need all the real credentials to run locally.
- Copy the
.env.test
into a local env file
cd web/
cp .env.test .env
- Edit any environment variables for which you have real credentials.
- AWS access (for KMS) is required to run the Developer Portal locally. KMS is used to sign/encrypt, particularly for Sign in with World ID. You will need to have AWS credentials in your env with relevant permissions to run KMS. Here is an IAM sample policy for this.
- If you are a core contributor with AWS access to TFH, follow the instructions here instead.
The following command will start two containers with the Postgres database, and Hasura server. Additionally, it will run the Next.js app from the /web directory. All Hasura migrations and metadata are automatically applied.
docker compose up --detach
cd web && pnpm dev
You can also take advantage of the Makefile, make up
End-to-end tests require Docker containers from previous block (Hasura & Postgres) to be running. You can start web app as well, but Playwright can start it for you automatically, if it won't find the app running on its default port.
Important
Make sure you set up required credentials in .env
-- you can find some of them in our shared password vault.
Install browsers for end-to-end tests runs if you run tests for the first time or haven't ran them for a long time:
cd web && npx playwright install
Note
These binaries are different than those executables and/or installation packages that you download the regular way. They are being stored in Playwright cache folder.
Run tests:
cd web && pnpm test:e2e
It's also recommended to use Playwright extension in Visual Studio Code if you debug or develop new tests. This extension helps you run individual tests or test groups and launch a debug mode with stops on breakpoints.
If you need to update anything related to the database (model, permissions, events, etc.) the easiest way is with the Hasura console.
-
Follow instructions to install the Hasura CLI.
-
Launch the Hasura console.
cd hasura hasura console --endpoint http://localhost:8080 --admin-secret secret!
You can also take advantage of the Makefile,
make hasura-console
Warning Make sure to only make the changes in the Hasura console (usually
http://localhost:9665
), if you make changes onhttp://localhost:8080
the migrations will not be generated and your changes will be lost.
💡 The admin secret in stored in
docker-compose.yml
file in the root of the repo.