IDKit JS is the new toolkit to interact with the World ID protocol. IDKit can instantly add sybil resistance to your apps by:
- Receive a signal someone is a unique human (through the Worldcoin orb).
- Receive a signal someone has a unique phone number (for less sensitive operations).
IDKit and the World ID protocol is fully privacy preserving.
Integration is very straightforward. Follow the relevant steps below.
yarn add idkit
# or
npm install idkit
If you're integrating IDKit with a Lens app, check out the Lens-specific docs here.
If your app is built on React, using the React widget is by far the easiest approach.
import { IDKitWidget } from "@worldcoin/idkit";
<IDKitWidget actionId="get_this_from_the_dev_portal" signal="my_signal" handleVerify={verifyProof}>
{({ open }) => (
{/* You can render whatever you want here, and call open() to open the widget */}
<button onClick={open}>Click me</button>
)}
</IDKitWidget>
Alternatively, you can render the component without children (on your layout, for example) and use the useIDKit
hook to open it programmatically.
import { useIDKit } from "@worldcoin/idkit";
const { open, setOpen } = useIDKit({
signal: "my_signal",
handleVerify: verifyProof,
actionId: "get_this_from_the_dev_portal",
walletConnectProjectId: "get_this_from_walletconnect_portal",
});
If your app doesn't have a framework or doesn't use React, continue here.
- Initialize IDKit (please refer to the docs for further customization details).
IDKit.init({
signal: "my_signal",
handleVerify: verifyProof,
actionId: "get_this_from_the_dev_portal",
walletConnectProjectId: "get_this_from_walletconnect_portal",
});
- Then, open the widget and await the proof (you can do this in response to a button click, for example).
button.addEventListener("click", async () => {
IDKit.open();
});
IDKit exposes the handleVerify
option for your app to perform additional verification on the returned response, often a call to an API that ensures the proof is valid.
Warning Make sure you verify the proof, and that you don't do it client-side!
Optionally, IDKit also provides an onSuccess
option, which you can use if your app needs to execute some code after verification succeeds.
If you want to develop or contribute to this project, please refer to the development instructions in the idkit
README.
World ID is the privacy-first identity protocol that brings global proof of personhood to the internet. More on World ID in the announcement blog post.
World ID lets you seamlessly integrate authentication into your app that verifies accounts belong to real persons through Sign in with Worldcoin. For additional flexibility and cases where you need extreme privacy, Anonymous Actions lets you verify users in a way that cannot be tracked across verifications.
Follow the Quick Start guide for the easiest way to get started.
All the technical docs for the Wordcoin SDK, World ID Protocol, examples, guides can be found at https://docs.worldcoin.org/