global-gateway-image-capture-web-sdk-test v4.0.23
GlobalGateway Image Capture Web SDK
This sample app contains the Acuant SDK with the HTML Sample App wrapper.
This README document is for developers only and will get removed automatically when prepping the sample app for production release.
Dev environment setup
Inside the repo root directory:
- Create
.envfile:
cp .env.template .envto create a new.envfile with this content:
SDK_USERNAME= // Acuant SDK username credential
SDK_PASSWORD= // Acuant SDK password credential
PORT= // Port on which to run the application. If blank, the port will default to 3000
ARTIFACTORY_DEVOPS_USER= // JFrog username
ARTIFACTORY_DEVOPS_PASSWORD= // JFrog password
NPM_TOKEN= // NPM token for nexus.rnd-trulioo.com/repository/npm-private- Apply credentials to demo app:
- After adding the credentials, run
export $(cat .env) - Then run the following commands:
sed -i -e "s|USERNAME_TO_REPLACE|$SDK_USERNAME|gi;s|PASSWORD_TO_REPLACE|$SDK_PASSWORD|gi" src-demo/app.tsYou should now see the change in src-demo/app.ts at username and password.
- Install dependencies and Acuant SDK:
yarn install- Start local development of demo app:
yarn dev --port <xxxx>- dev server port defaults to
3000if no--portspecified
Build
Build for production:
yarn buildwhich includes:
yarn build:dist-- build distribution filesyarn build:lib-- build JS files for npm packagingyarn build:types-- build definition files for npm packaging
Build for development:
yarn build:devSimilar to yarn build but without production flag, the dist/ would include non-minified and sourcemap details.
Utils
Clean up built files/assets:
yarn cleanLint code in src and src-demo:
yarn lintApply code formatting for src and src-demo:
yarn formatTest
Run unit tests:
yarn testwhich runs all tests in __tests__/ with pattern *.test.ts|js.
Run distribution
There are two options to run distribution build on your local machine and with docker.
Prerequisite: step '1. Create .env file' of section Dev environment setup.
Run on local machine
yarn install
yarn build
export $(cat .env)
./scripts/populateAcuantCredentials.sh
yarn startBrowse the output url, http://localhost:8080 by default.
Run with docker
docker-compose build
docker-compose upBrowse the output url, http://localhost:3000 by default.