Skip to main content
Language

Configuration Settings of Getty Images Library SDK

In this example, we will show you how to configure the Getty Images Library SDK.

In addition to the PE.SDK's basic configuration options the Getty Images Library SDK comes with a set of additional configuration parameters.

gettyAPIKey#

The client-side Getty Images API key which you can request here.

gettyTokenURL#

The URL that implements the OAuth flow with Getty's resource server. This defaults to the current host with the path api/token.

gettyTokenURL#

Promise that returns the OAuth token. This option provides more flexibility than the gettyTokenURL.

displaySize#

The size of the preview image displayed by the editor.

searchParams#

Search parameters for the Getty Images API, refer to Getty Images documentation for a complete list.

imageSize#

The size of the final image generated on export.

endpoint#

Allows setting the default image search endpoint. If left blank all images will be searched.

onError#

A function to handle errors occurring at the API level. Reference the full list here.

onConfirm#

A function that is invoked on export before licensing an image passing the following arguments:

  • onExportLicensedImage licenses the image, loads it into the editor and returns the URL for the licensed image for further handling.
  • image contains image metadata as returned by the Getty Images API.
  • onLicense licenses the image and returns a URL without loading it into the editor.
  • onClick triggers the export event which can be used to save a serialization of the editor state.