# License key is not recognized in production

**URL:** <https://pdfjs.community/t/license-key-is-not-recognized-in-production/1301>\
**Category:** Technical Support\
**Created:** [January 14, 2022, 6:01pm UTC](https://pdfjs.community/t/license-key-is-not-recognized-in-production/1301 "2022-01-14T18:01:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Antoine](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Antoine](https://pdfjs.community/u/Antoine)\
**Post date:** [January 14, 2022, 6:01pm UTC](https://pdfjs.community/t/license-key-is-not-recognized-in-production/1301/1 "2022-01-14T18:01:40Z")

</div>

**PDF.js Express Version**

**Detailed description of issue**

Hi,

in production, when I load a file with the PDF Express Viewer, I have this error message  
"A valid license key is required to use the view only build of PDF.js "

However, I did create a license key and used it as an option parameter. It even perfectly works in localhost :  
From my account, I have created 2 keys :

- one for the “localhost:3000” domain : it works.
- one for the domain [capla360.com](http://capla360.com) : I have the error.

I’m using a React app and used .env to set the 2 keys for the 2 different envs. I can’t figure out what’s going wrong…

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/796d921900483257802e0c6d4fd65296d61d1ba7.png)

**Expected behaviour**

the document should load in production, similarly to what is happening in localhost.

**Does your issue happen with every document, or just one?**  
yest

**Code snippet**  
Here how the WebViewer is configured.

```javascript
  WebViewer(
      {
        path: "../../../pdftron/public",
        licenseKey: process.env.REACT_APP_PDFTRON_EXPRESS_KEY,
        initialDoc: url,
      },
      viewerRef.current
    );

```

---

_[View the full topic](https://pdfjs.community/t/license-key-is-not-recognized-in-production/1301)._
