Skip to content

Commit

Permalink
Update README.md with CSP notes (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Faris Mahmutovic <[email protected]>
  • Loading branch information
e271828- and faris-imi authored Nov 5, 2024
1 parent e3d30a9 commit 543c7aa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ This is a JavaScript library to easily configure the loading of the [hCaptcha](h
1. [Installation](#installation)
2. [Implementation](#implementation)
3. [Props](#props)
3. [Legacy Support](#legacy-support)
4. [Legacy Support](#legacy-support)
5. [CSP](#CSP)

### Installation
## Installation
```
npm install @hcaptcha/loader
```

### Implementation
Or use UNPKG to load via CDN, [as described below](#CDN).

## Implementation

```js
import { hCaptchaLoader } from '@hcaptcha/loader';
Expand All @@ -30,7 +33,7 @@ hcaptcha.render({
const { response } = await hcaptcha.execute({ async: true });
```

### Props
## Props
| Name | Values/Type | Required | Default | Description |
|-------------------|-------------|----------|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `loadAsync` | Boolean | No | `true` | Set if the script should be loaded asynchronously. |
Expand Down Expand Up @@ -111,3 +114,7 @@ The hCaptcha Loader targeted for older browsers can also be imported via CDN by
</body>
</html>
```

## CSP

Note that you should use the `strict-dynamic` policy for this loader, as it needs to load the SDK via `appendChild()`.

0 comments on commit 543c7aa

Please sign in to comment.