# Initializing DigitalRiver.js

‌Use `DigitalRiver(publishableAPIKey)` to create an instance of the [`DigitalRiver` object](https://docs.digitalriver.com/commerce-api/resources/reference/digitalriver-object). The function requires a [public API key](https://app.gitbook.com/s/oUderMtztdH7OKDXmYbI/commerce-api-reference-guide/api-structure/api-keys#public-keys).&#x20;

```javascript
let digitalriver = new DigitalRiver("YOUR_PUBLIC_API_KEY", {
     "locale": "en-us"
});
```

It also accepts [`options`](#localizing-digitalriver.js) (*optional*) using the following format: `DigitalRiver(publishableApiKey[, options])`

## ‌Localizing DigitalRiver.js

In `options`, you can specify a `locale` to localize the library.

The following example translates the various display and error strings within DigitalRiver.js into Italian ‌by assigning `it` to `locale`.

```javascript
let digitalriver = new DigitalRiver("YOUR_PUBLIC_API_KEY", {
     "locale": "it"
});
```
