recaptcha-v3-verify
Version:
A TypeScript npm plugin for verifying reCAPTCHA tokens.
48 lines (30 loc) • 1.09 kB
Markdown
A simple module to verify Google reCAPTCHA responses using Node.js and TypeScript.
```bash
npm install recaptcha-v3-verifier
```
**Usage in CommonJS:**
```bash
const { verifyRecaptcha } = require('recaptcha-verifier');
(async () => {
const response = await verifyRecaptcha('your-secret', 'user-response-token');
console.log(response);
})();
````
**Usage in ESM:**
```bash
import { verifyRecaptcha } from 'recaptcha-verifier';
(async () => {
const response = await verifyRecaptcha('your-secret', 'user-response-token');
console.log(response);
})();
```
MIT License
Copyright (c) 2024 Your Name
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: