script
script
is an optional property that allows you to inject plain javascript to the page before taking the screenshot. By default no script is injected.
api/routes/screenshot.ts
const { UrlToImage } from '@url2image/sdk'
const { data, success, message } = await UrlToImage({
url: 'URL_TO_SCREENSHOT',
token: 'YOUR_API_KEY',
options: {
script: 'YOUR_JS_CODE'
}
})