Skip to content

Commit

Permalink
docs: Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
grijeshsaini committed Dec 15, 2023
1 parent e1a1f9b commit 7aee57e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,25 @@ When supplied, the toCanvas function will return a blob matching the given image

Defaults to `image/png`

### fetchRequestInitGenerator

```ts
(url: string) => RequestInit | undefined
```

This function is intended to provide a convenient way to customize the RequestInit configuration for fetching data from a specific URL.
For example,

```ts
htmlToImage.toCanvas(node, {
fetchRequestInitGenerator: (url: string) => {
url.includes('/internal')
? { credentials: 'include' }
: undefined
}
});
```

## Browsers

Only standard lib is currently used, but make sure your browser supports:
Expand Down

0 comments on commit 7aee57e

Please sign in to comment.