Deployment Activation
Deployment: Self-hosted, Offline, or Intranet
The following steps guide you through how to deploy the library on your own server.
Step One: Deploy the dist folder
Locate the dist/ directory under the installation folder of the library and simply copy the entire directory to your server. The dist/ folder should contain the following files:
dbr.js
// For<script>
dbr.browser.mjs
// For<script type="module">
dbr.scanner.html
// Scanner default UIdbr-<version>.worker.js
// A worker thread for decodingdbr-<version>.wasm.js
// Compact Edition JSdbr-<version>.wasm
// Compact Edition WASMdbr-<version>.full.wasm.js
// Full Edition JSdbr-<version>.full.wasm
// Full Edition WASM
If the resource files (e.g.,wasm
files) are not placed in the same directory as dbr.js
, you will need to specify the path using the API engineResourcePath
before calling loadWasm
or createInstance
.
Dynamsoft.BarcodeReader.engineResourcePath = "url/to/the/dir/";
Step Two: Configure the Server
Set the MIME type for .wasm
to application/wasm
.
Different servers are configured differently. Here are some popular ones:
- NGINX:
mime.types
- IIS:
Web.config
- Java™ EE web app:
web.xml
- Node.js:
npm mime
License Activation
A full license is required for deployment. If you have not purchased a license yet, please visit our online store.
Step One : Create a Dynamsoft account
If you don’t have an Dynamsoft account yet, sign up here. Be sure to use the same email that was registered for the purchase.
Step Two : Log into Dynamsoft Customer Portal
Once logged in, click License in the left menu bar to show your purchased license(s).
Step Three : Activate the License
Under Status, click Activate Now to specify a domain to bind your license key. The domain binding is a security feature to protect your license, optional but highly recommended.
A few examples of the domain:
- www.dynamsoft.com
- demo.dynamsoft.com
- *.dynamsoft.com
- *.dynamsoft.com; *.yoursite.com
Step Four : Use the License
<!-- Please visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=guide&product=dbr&package=js to get a trial license. -->
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@7.5.0-v1/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
In the above sample code, simply replace PRODUCT-KEYS
with your activated key.