# ivyforms/1.1/backend/src/Services/Security/Recaptcha/RecaptchaConfigProvider.php

The Innovative Form Builder – IvyForms, version 1.1. 47 lines.

- Page: https://pluginprobe.com/plugins/ivyforms/1.1/code/backend/src/Services/Security/Recaptcha/RecaptchaConfigProvider.php
- Raw: https://pluginprobe.com/plugins/ivyforms/1.1/raw/backend/src/Services/Security/Recaptcha/RecaptchaConfigProvider.php
- Modified: 2026-05-06T08:31:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ivyforms/1.1/code/backend/src/Services/Security/Recaptcha/RecaptchaConfigProvider.php#L10-L20`.

```php
<?php

/**
 * @copyright © Melograno Venture Studio. All rights reserved.
 * @licence   See COPYING.md for license details.
 */

namespace IvyForms\Services\Security\Recaptcha;

use IvyForms\Services\Security\Common\CaptchaServiceInterface;

/**
 * Provides reCAPTCHA frontend configuration
 *
 * @package IvyForms\Services\Security\Recaptcha
 */
class RecaptchaConfigProvider
{
    /**
     * Get reCAPTCHA configuration for frontend
     *
     * @param CaptchaServiceInterface|null $service
     * @return array<string, mixed>
     */
    public function getConfig(?CaptchaServiceInterface $service): array
    {
        $config = [
            'configured' => false,
            'type' => 'v2',
            'siteKey' => '',
            'scriptUrl' => '',
            'size' => 'normal'
        ];

        if ($service && $service->isConfigured()) {
            $recaptchaConfig = $service->getFrontendConfig(
                $service->getType(),
                $service->getSiteKey()
            );
            $recaptchaConfig['configured'] = true;
            return $recaptchaConfig;
        }

        return $config;
    }
}

```
