Catalyst version 1.6.0 Release Notes
We are excited to announce the release of Catalyst v1.6.0, which adds reCAPTCHA v2 support to storefront forms, including registration, contact, and product review forms.
For additional details, you can refer to the Catalyst 1.6 changeset.
reCAPTCHA v2 support
Catalyst now supports reCAPTCHA v2 on the registration, contact us, and product review forms. When reCAPTCHA is enabled in the BigCommerce admin, a reCAPTCHA widget is rendered on each supported form. Validation is performed server-side in the corresponding form actions — the token is read from the native g-recaptcha-response field that the reCAPTCHA widget injects into the form, so no manual client-side token extraction is required.
Migration
- Install the required dependencies:
-
Create
core/lib/recaptcha/constants.tswith theReCaptchaSettingsinterface andRECAPTCHA_TOKEN_FORM_KEYconstant, and create thecore/lib/recaptcha.tsserver-side helper withgetRecaptchaFromFormandassertRecaptchaTokenPresentutilities. -
Add
recaptchaRequiredtranslation strings tocore/messages/en.jsonfor the following namespaces:Auth.RegisterProduct.Reviews.FormWebPages.ContactUs.FormForm
-
Update the following GraphQL mutations to accept an optional
$reCaptchaV2: ReCaptchaV2Inputvariable:register-customer.tssubmit-review.tssubmit-contact-form.ts
-
Add server-side reCAPTCHA token validation in each of the three form actions using
getRecaptchaFromFormandassertRecaptchaTokenPresent. -
Fetch
recaptchaSiteKeyviagetRecaptchaSiteKey()and pass it into form components from:register/page.tsxproduct/[slug]/page.tsxwebpages/[id]/contact/page.tsx
-
Render the
<RecaptchaWidget>component (fromreact-google-recaptcha) inside:dynamic-form/index.tsxreviews/review-form.tsx
-
Thread the
recaptchaSiteKey?: stringprop through the following intermediate components:dynamic-form-section/index.tsxproduct-detail/index.tsxreviews/index.tsxproduct/[slug]/_components/reviews.tsx
Due to the number of changes involved, it is recommended to use the PR as a reference for migration.
Release Tags
We have published new tags for the Core and Makeswift versions of Catalyst. Target these tags to pull the latest code:
And as always, you can pull the latest stable release with these tags: