Verifying solutions in Node.js
1. Install and import the @botpoison/node library.
npm install @botpoison/node
2. Create a new Botpoison instance with your secret key.
3. Verify the solution using the verify() function.
javascript
// 1. Import the libraryimport Botpoison from "@botpoison/node";// or const Botpoison = require("@botpoison/node")// 2. Create a new instance with your secret keyconst botpoison = new Botpoison({secretKey: "sk_xxxxxxxx"});server.post("/message", async (req, res) => {const { message, _botpoison } = req.body;// 3. Verify the solutionconst { ok } = await botpoison.verify(_botpoison);if (!ok) {throw new Error("Invalid Botpoison solution");}// ...});