All Projects → aureatelabs → Vsf Google Recaptcha

aureatelabs / Vsf Google Recaptcha

Licence: mit
Google Invisible reCAPTCHA v3 extension for Vue Storefront to preventing bot form submission

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Vsf Google Recaptcha

vsf-payment-razorpay
Razorpay Payment Extension for Vue Storefront - Integrated to accept online payment
Stars: ✭ 15 (-25%)
Mutual labels:  pwa, magento2
Vue Storefront
The open-source frontend for any eCommerce. Built with a PWA and headless approach, using a modern JS stack. We have custom integrations with Magento, commercetools, Shopware and Shopify and total coverage is just a matter of time. The API approach also allows you to merge VSF with any third-party tool like CMS, payment gateways or analytics. Ne…
Stars: ✭ 9,111 (+45455%)
Mutual labels:  magento2, pwa
Magento Docker
Docker environment dedicated for ScandiPWA theme development
Stars: ✭ 98 (+390%)
Mutual labels:  magento2, pwa
vsf-external-checkout
VueStorefront External Checkout module
Stars: ✭ 26 (+30%)
Mutual labels:  pwa, magento2
how-to-venia
Magento PWA Storefront based on PWA Studio's Venia Storefront (Concept)
Stars: ✭ 39 (+95%)
Mutual labels:  pwa, magento2
React Storefront
Build and deploy e-commerce progressive web apps (PWAs) in record time.
Stars: ✭ 275 (+1275%)
Mutual labels:  magento2, pwa
magento2-webappmanifest
A Magento 2 extension that adds a Web App Manifest to the store.
Stars: ✭ 19 (-5%)
Mutual labels:  pwa, magento2
React Storefront
React Storefront - PWA for eCommerce. 100% offline, platform agnostic, headless, Magento 2 supported. Always Open Source, Apache-2.0 license. Join us as contributor ([email protected]).
Stars: ✭ 292 (+1360%)
Mutual labels:  magento2, pwa
Awesome Magento2
Curated list of awesome Magento 2 Extensions, Resources and other Highlights
Stars: ✭ 817 (+3985%)
Mutual labels:  magento2
Flutter Cinema
Learn to create flutter app with BLoC Architecture
Stars: ✭ 26 (+30%)
Mutual labels:  pwa
Ghchat
📱A chat application for GitHub. React + PWA + Node(koa2) + Typescripts + Mysql + Socket.io
Stars: ✭ 791 (+3855%)
Mutual labels:  pwa
Vuefront Nuxt
Vuefront Nuxt module for building components based on config.
Stars: ✭ 16 (-20%)
Mutual labels:  pwa
Laravel Pwa
Laravel with Progressive Web Apps (PWA)
Stars: ✭ 26 (+30%)
Mutual labels:  pwa
Demo Progressive Web App
🎉 A demo for progressive web application with features like offline, push notifications, background sync etc,
Stars: ✭ 798 (+3890%)
Mutual labels:  pwa
Thinkful Workshop React Redux Node Mongodb Webpack2
Stars: ✭ 12 (-40%)
Mutual labels:  pwa
Pwa Studio
🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
Stars: ✭ 779 (+3795%)
Mutual labels:  pwa
Jekyll Theme Chirpy
A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.
Stars: ✭ 773 (+3765%)
Mutual labels:  pwa
Magento2 Module Mailcatcher
Magento 2 Module to catch, log and redirect emails on Local and Dev Servers
Stars: ✭ 14 (-30%)
Mutual labels:  magento2
Generator Mage2
Yeoman generator for Magento 2 extensions (modules and themes)
Stars: ✭ 12 (-40%)
Mutual labels:  magento2
Mage2 Ordered Assets
Order assets (read: css tags) explicitly with an order attribute
Stars: ✭ 23 (+15%)
Mutual labels:  magento2

Vue Storefront Google Invisible reCAPTCHA extension

Google Invisible reCAPTCHA v3 integration for vue-storefront, by Aureate Labs

This extension helps to prevent bot form submission using Google reCAPTCHA service

Note: Google reCAPTCHA registration required (It's a free) to use this extension into your vue-storefront website.

Google reCAPTCHA is for the protect the spamming your any submiting form and idea about to do some other stuff authentication to prevent this.

Demo

Google reCAPTCHA documentation: https://developers.google.com/recaptcha/intro

Installation:

1. Clone the repository

Clone the vsf-google-recaptcha repository into your VSF installation.

$ git clone [email protected]:aureatelabs/vsf-google-recaptcha.git vue-storefront/src/modules/google-recaptcha

2. Add the extension config to your local VSF configuration file.

Add the following JSON config snippet into your desired config, eg. config/local.json

"googleRecaptcha" : {
   "tokens" : {
       "site_key": "<YOUR_CAPTCHA_SITE_KEY>",
       "secret_key": "<YOUR_CAPTCHA_SECRET_KEY>"
   },
   "endpoint": "/api/ext/google-recaptcha/is-verify",
   "is_active": false
}

Replace the site_key & secret_key parameter with the site key & secret key provided by Google reCAPTCHA registration time. You can find your Captcha Site Key here: https://www.google.com/recaptcha/admin/. Setting is_active to false will disable the google reCAPTCHA extension at runtime.

Valid site_key example: "site_key": "6Lcn_Z0UAAAAAN4LdRSfM5eNd3LJ-xPfUtnV6Lud" Valid secret_key example: "secret_key": "6Lcn_Z0UAAAAACodWP8oU9wcdVKatvQVBqklWA9c"

3. Register the Google reCAPTCHA extension

Open up your ../vue-storefront/src/modules/index.ts and add the following code. Adding it inside this file the registers the extension so it can be used in your Vue Storefront.

import { GoogleRecaptcha } from './google-recaptcha'
...
export const registerModules: VueStorefrontModule[] = [
...
GoogleRecaptcha
...
]

4. How to call captcha method

In your theme template file you can directly call store action and immediate next you can check captcha is verified or not

this.$store.dispatch('googleRecaptcha/isVerifiedCaptcha')
if (!this.$store.state.googleRecaptcha.is_verified) {
    //captcha is not verified
}

5. Now, Clone google reCAPTCHA API extension to your local vue-storefront-api

Copy extension to your /path/to/vue-storefront-api/src/api/extensions/

$ cp -f ./API/google-recaptcha /path/to/vue-storefront-api/src/api/extensions/

6. Add the extension config to your local VSF API's configuration file

Add the following JSON config snippet into your desired config, eg. config/local.json

"googleRecaptcha" : {
  "tokens" : {
      "secret_key": "<YOUR_CAPTCHA_SECRET_KEY>"
  },
  "score_match": {
    "enable": false,
    "low_score": 0.9
  }
}

Replace the secret_key parameter with the secret key provided by Google reCAPTCHA registration time. You can find your Captcha Site Key here: https://www.google.com/recaptcha/admin/. Setting enable to true will check the captcha base on the score response from the google captcha api. To disable score match simple set value to false. Possible values for low_score is 0.0 to 0.9.

Valid secret_key example: "secret_key": "6Lcn_Z0UAAAAACodWP8oU9wcdVKatvQVBqklWA9c"

Sample response of api call /api/ext/google-recaptcha/is-verify

{ success: false, error: 'Invalid captcha found.' }

7. Enjoy!

Thats it! It's easy, plug and play! If you haven't got an Register captcha already, you can create one here, there is free tier that you can use to get started: https://www.google.com/recaptcha/admin/create

Customization

Replacing the Google captcha Script.

If you need to change the Intercom script that is loaded on the page, open up the ./google-recaptcha/hooks/afterRegistration.ts file. On line 35 you'll find the script provided from Google reCAPTCHA, you can swap this out or extend it as required.

License

This project is licensed under the MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].