Skip to content

Commit

Permalink
Fix code examples in README
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinfuchs committed Apr 18, 2024
1 parent 4883c22 commit 550e35a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ First configure and create a SDK client
```php
use FriendlyCaptcha\SDK\{Client, ClientConfig}

$config = new \FriendlyCaptcha\SDK\ClientConfig();
$config = new ClientConfig();
$config->setAPIKey("<YOUR API KEY>")->setSitekey("<YOUR SITEKEY (optional)>");

// You can also specify which endpoint to use, for example `"global"` or `"eu"`.
// $config->setEndpoint("eu")

$captchaClient = new \FriendlyCaptcha\SDK\Client()
$captchaClient = new Client($config)
```

Then use it in the endpoint you want to protect
Expand Down Expand Up @@ -78,6 +78,9 @@ php bin/composer-setup.php --install-dir=bin --2.2 LTS

```shell
bin/composer.phar install

# Include the autoload file in your code
require __DIR__ . '/vendor/autoload.php';
```

### Run the tests
Expand All @@ -88,7 +91,9 @@ First download the [friendly-captcha-sdk-testserver](https://github.com/Friendly
# Run the friendly-captcha-sdk-testserver
./friendly-captcha-sdk-testserver serve
```

Then open a new terminal, and run the following

```shell
# Generate the autoload files
./bin/composer.phar dump
Expand Down

0 comments on commit 550e35a

Please sign in to comment.