Authorize service-to-service calls and report every request from an Express app. npm install end-point-blank-js and add two middleware.
Published on npm.
npm install end-point-blank-js
Use the client ID and secret of an application environment you created in EndPointBlank.
const epb = require('end-point-blank-js');
const { reportInteraction, reportInteractionErrorHandler } =
require('end-point-blank-js/middleware');
epb.configure({
clientId: process.env.ENDPOINTBLANK_CLIENT_ID,
clientSecret: process.env.ENDPOINTBLANK_CLIENT_SECRET,
appName: 'orders-service',
environment: 'production',
});
app.use(reportInteraction);
app.use(routes);
app.use(reportInteractionErrorHandler); // after your routes
reportInteraction reports every request and response; the error handler, registered after your routes, captures anything they throw.
const { authorized } = require('end-point-blank-js/express');
router.get('/orders', authorized, listOrders);
authorized checks the caller against your grants and passes an UnauthorizedError to next() when it is refused. Allowed answers are cached in-process for cacheTtl seconds.
The README covers every setting: masking rules, the authorization cache, authorizing outbound calls and the management API client. The quickstart walks through creating the application and credentials this page assumes.
Deprecate and retire versions without breaking customers.
Scoped, rotatable credentials for service-to-service calls.
Every call between services, searchable and reassembled.
Know which client is failing, before they tell you.
Invite client organizations and grant them API packages.
Sign up in under a minute. No credit card, no sales call.