Google reCAPTCHA
How to integrate Google reCAPTCHA in your application.
Sign in to Google reCAPTCHA
Go into Google reCAPTCHA and sign in.
Register a new site
Select Create
button inside the Register a new site
section.
// import homeRecaptcha from '@/assets/guides/captcha/google.png';
Add your domain and select the reCAPTCHA type you want to use.
Provide keys to VitNode
Edit your app.module.ts
file and add captcha
object to the VitNodeModule
configuration.
@Module({
imports: [
VitNodeCoreModule.register({
database: {
config: DATABASE_ENVS,
schemaDatabase,
},
captcha: {
type: 'recaptcha_v3', // or 'recaptcha_v2_invisible' or 'recaptcha_v2_checkbox'
site_key: process.env.CAPTCHA_SITE_KEY,
secret_key: process.env.CAPTCHA_SECRET_KEY,
},
}),
DatabaseModule,
PluginsModule,
CacheModule.register({
isGlobal: true,
}),
],
})
export class AppModule {}