# Initializing DigitalRiver.js

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

{% code overflow="wrap" %}

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

{% endcode %}

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.

For a list of accepted values, refer to [Supported languages](https://app.gitbook.com/s/ZrhMyLX5esFYS64lNWVW/digital-river-api-reference-guide/supported-languages).

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

{% code overflow="wrap" %}

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

{% endcode %}

‌
