6. SDK Installation

In order to use the UNL SDK, you need to install the unl-js-api library.

npm install unl-js-api –save

Add a new entry in the .config file.

UNL_API_KEY: "YOUR-UNL-API-KEY";

Create a new file under the src directory which will contain the SDK initialization (we named it unlApi.js). Replace YOUR-UNL-API-KEY in the .config file with a valid API key (follow the steps from the previous chapter to obtain it).

import config from "../config";
import UnlApi from "unl-js-api/dist";
const UNL_API_KEY = config.UNL_API_KEY;
const unlApi = new UnlApi({ apiKey: UNL_API_KEY });