Create an Express / Connect-compatible middleware that:
req.bbasContext
'block'
blockHandler
You must still pass req.bbasContext as the context argument when calling deviceManager.identify() for the enrichment to run.
context
deviceManager.identify()
app.use(createBbasMiddleware(bbasManager, { mode: 'block' }));app.post('/identify', (req, res) => { const result = await deviceManager.identify(req.body, req.bbasContext); if (result.bbasDecision === 'challenge') { … } res.json(result);}); Copy
app.use(createBbasMiddleware(bbasManager, { mode: 'block' }));app.post('/identify', (req, res) => { const result = await deviceManager.identify(req.body, req.bbasContext); if (result.bbasDecision === 'challenge') { … } res.json(result);});
Create an Express / Connect-compatible middleware that:
req.bbasContext.'block'mode, calls theblockHandler(or sends 403) when the decision reaches'block'.You must still pass
req.bbasContextas thecontextargument when callingdeviceManager.identify()for the enrichment to run.