# Local Angular - A valid license key is required to use the view only build of PDF.js Express

**URL:** <https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705>\
**Category:** Technical Support\
**Created:** [July 11, 2023, 6:49pm UTC](https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705 "2023-07-11T18:49:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve.haney](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@steve.haney](https://pdfjs.community/u/steve.haney)\
**Post date:** [July 11, 2023, 6:49pm UTC](https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705/1 "2023-07-11T18:49:18Z")

</div>

**Which product are you using?**  
PDF.js Express Viewer

**PDF.js Express Version**  
UI - 8.7.0, Core - 8.7.4

**Detailed description of issue**  
I am locally running an Angular app where my URL is [https://acme.app.local](https://acme.app.local). I have a license defined for the domain app.local but in my app I am getting this error message:

I see the request to [https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1](https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1) come back with a 200 and the header Origin is [https://acme.app.local](https://acme.app.local).

I saw this ticket [Local domain + port; licenseKey not recognised - #21 by zserviss](https://pdfjs.community/t/local-domain-port-licensekey-not-recognised/2007/21) and thought it should work but its not unfortunately.

**Code snippet**  
{Provide a relevant code snippet}

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [July 12, 2023, 5:37pm UTC](https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705/3 "2023-07-12T17:37:06Z")

</div>

Hello steve.haney,

> " I see the request to [https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1](https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1) come back with a 200 and the header Origin is [https://acme.app.local](https://acme.app.local/)."

HTTP Status Code 200 is a correct response, this is not an error.

Can you provide more information? a screenshot of the error?

Best regards,  
Tyler

---

<div class="post-metadata">

**Author:** ![steve.haney](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@steve.haney](https://pdfjs.community/u/steve.haney)\
**Post date:** [July 12, 2023, 5:53pm UTC](https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705/4 "2023-07-12T17:53:31Z")

</div>

Sure, the error in browser console is the following:

```javascript
Error: PDFJS.express: A valid license key is required to use the view only build of PDF.js Express. Get your free license key at https://pdfjs.express/profile (account required)
    at p.e (PDFJSDocumentType.js:2562:250)
    at pdfjsexpress.view-only.wasm:0x2167
    at e.value (PDFJSDocumentType.js:2546:117)
    at b (PDFJSDocumentType.js:2564:484)
    at PDFJSDocumentType.js:2571:251
    at L (PDFJSDocumentType.js:2520:340)
    at Generator._invoke (PDFJSDocumentType.js:2520:92)
    at t$jscomp$0.<computed> [as next] (PDFJSDocumentType.js:2521:25)
    at n$jscomp$0 (PDFJSDocumentType.js:2274:389)
    at c (PDFJSDocumentType.js:2275:65)
error @ PDFJSDocumentType.js:107
12:52:35.782 

```

---

<div class="post-metadata">

**Author:** ![steve.haney](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@steve.haney](https://pdfjs.community/u/steve.haney)\
**Post date:** [July 12, 2023, 5:54pm UTC](https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705/5 "2023-07-12T17:54:56Z")

</div>

This is the response of the call to [auth.pdfjs.express](http://auth.pdfjs.express). I can’t tell if its expected or not in this format.

```javascript
{"key":"è½ÅèÜþ»÷úá÷àÛÅþÆÜþìçÅäÈùý"}

```

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [July 13, 2023, 5:14pm UTC](https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705/6 "2023-07-13T17:14:52Z")

</div>

Hello steve.haney,

The key looks incorrect, its in a format that is includes the characters: [a-z], [A-Z], [0-9]. Are you modifying the text in some way?

Best regards,  
Tyler

---

<div class="post-metadata">

**Author:** ![steve.haney](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@steve.haney](https://pdfjs.community/u/steve.haney)\
**Post date:** [July 13, 2023, 5:30pm UTC](https://pdfjs.community/t/local-angular-a-valid-license-key-is-required-to-use-the-view-only-build-of-pdf-js-express/2705/7 "2023-07-13T17:30:13Z")

</div>

Yes, I agree the key returned looks wonky. The key I have in my javascript is the one being passed in the URL [https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1](https://auth.pdfjs.express/?key=vvDl16bko1qkvdFGq6A4&r=1).

As I said this error is not happening when hosting this on AWS so it seems to be an issue with our local setup using the root URL ([https://acme.app.local](https://acme.app.local)). At least according to my account license keys that key matches up to the domain app.local.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/f/f63a08132cd8301d324023cb1fac62b8a477905e.png)
