shieldsquare-middleware-latest v7.0.8
SHIELD-CONNECTOR
Official ShieldSquare Node.js express connector.
Version: 7.0.7
Supports
- Node.js version (>= 18.0.0)
- This connector architects on top of middleware concept.
How do I get set up?
Shield Square Supports two modes of connection,
- Monitor Mode (Async)
- Active Mode (Sync)
The connector supports both of the them out of the box.
Calltype & UserId Params
Calltype defaults to 1 if it is not provided & userId defaults to '' if it is not provided.
Both the values are taken as query string parameter.
For Ex: http://localhost:3000?calltype=2&userId=12345
Nodejs Setup :
Install nvm in Linux Machine: (Node virtual manager used to switch nodejsversions)
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
source ~/.nvm/nvm.sh (Install nvm )
Install nodejs 18 using nvm :
nvm list ( To see list of node js versions )
nvm install –lts (Installs latest nodejs version)
Install node js plugin packages:
npm install shieldsquare-middleware-latest (Installs latest version 7.0.7)
npm install shieldsquare-middleware-latest
Place/Add ss2_config. json in your application.
Add shieldsquare-middleware-latest in your application
var shieldConnector = require('shieldsquare-middleware-latest'); shieldConnector.setConfigfilePath("path_to/ss2_config.json") // Please add the Absolute path to ss2_config.json file. app.use(shieldConnector.validateShieldsquare()) // Calling ShieldSquare middleware in the application.