Options
Theme Mode

themeMode

themeMode is an optional property that sets the color prefered theme mode of the page. By default is set to auto which means the page will use the color scheme preference of the user.

The available options are:

  • auto: The page will use the color scheme preference of the user.
  • light: The page will use the light color scheme.
  • dark: The page will use the dark color scheme.
  • no-preference: The page will not use any color scheme preference.
api/routes/screenshot.ts
const { UrlToImage } from '@url2image/sdk'
 
const { data, success, message } = await UrlToImage({
    url: 'URL_TO_SCREENSHOT',
    token: 'YOUR_API_KEY',
    options: {
        themeMode: 'dark'
    }
})