> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/digital-river-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/digital-river-api/developer-resources/digitalrivercheckout.js-reference/initializing-digitalrivercheckout.js.md).

# Initializing DigitalRiverCheckout.js

Learn how to use your public API key and an optional configuration object to create an instance of DigitalRiverCheckout

Use `DigitalRiverCheckout()` with the [`new`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new) operator to construct an instance of the [`DigitalRiverCheckout` object](/digital-river-api/developer-resources/digitalrivercheckout.js-reference/digitalrivercheckout-object.md). This function accepts a required [public API key](https://docs.digitalriver.com/digital-river-api-reference/digital-river-api-reference-guide/api-structure#public-keys) and an optional [configuration object](/digital-river-api/developer-resources/digitalrivercheckout.js-reference/initializing-digitalrivercheckout.js/digitalrivercheckout-configuration-object.md).

```javascript
const digitalRiverCheckout = new DigitalRiverCheckout('YOUR_PUBLIC_API_KEY', config);
```
