Socket
Socket
Sign inDemoInstall

@solargis/lambda-captcha

Package Overview
Dependencies
3
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 3.0.1

2

package.json
{
"name": "@solargis/lambda-captcha",
"version": "3.0.0",
"version": "3.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -39,2 +39,31 @@ # lambda-captcha

### Generating a captcha in code mode
```js
const lambdaCaptcha = require('@solargis/lambda-captcha')
const SECRET = process.env.CAPTCHA_SECRET
function generateCaptcha() {
const captchaConfig = lambdaCaptcha.LambdaCaptchaConfigManager.default(SECRET)
const captcha = lambdaCaptcha.create({
...captchaConfig,
mode: 'code', // default mode is 'math'
codeLength: 5, // optional, default codeLength is 5
})
return {
// The captcha SVG that you can display inside e.g. a form
captchaSvg: captcha.captchaSvg,
// This is the un-encrypted expression of the captcha.
captchaExpression: captcha.expr,
// This is the encrypted expression of the captcha.
// Pass it along with your server side verification requests.
encryptedCaptchaExpression: captcha.encryptedExpr
}
}
```
### Verifying a captcha

@@ -41,0 +70,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc