import { MiniKit } from "@worldcoin/minikit-js";
// ...
const handleVerify = async () => {
// ...
// The async versions of commands, return an object that contains the final payload, which is the response from World App,
// as well as commandPayload, which is the object that is returned after calling the command.
const { finalPayload } = await MiniKit.verifyAsync({
//...
});
if (finalPayload.status === "error") {
return console.log("Error payload", finalPayload);
}
// Verify the proof in the backend
const verifyResponse = await fetch("/api/verify", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: {
// ...
},
});
};