UNPKG

@bitstreamapis/bitstream-node

Version:

The analytics and intelligence layer for your APIs

47 lines (30 loc) 1.1 kB
# Bitstream Node.js Library ![NPM Version](https://img.shields.io/npm/v/%40bitstreamapis%2Fbitstream-node) ![NPM Downloads](https://img.shields.io/npm/dm/%40bitstreamapis%2Fbitstream-node) The analytics and intelligence layer for your APIs. Please see [bitstreamapis.com](https://www.bitstreamapis.com) for more information and to sign up for an account. ## Installation ```sh npm install @bitstreamapis/bitstream-node ``` ## Usage ### Express.js Bitstream can be used as a middleware in an Express.js application. **app.js** ```js const { useBitstream } = require('@bitstreamapis/bitstream-node'); useBitstream(app, { serviceId: process.env.BITSTREAM_SERVICE_ID, logLevel: process.env.BITSTREAM_LOG_LEVEL, // maskFields: ['sensitiveFieldName1', 'sensitiveFieldName2'], // excludeEndpoints: ['/example'], }); ``` **.env** ```js BITSTREAM_SERVICE_ID = 'YOUR-SERVICE-ID'; BITSTREAM_LOG_LEVEL = 20; ``` ### Fastify Currently in beta testing. Please get in touch if you'd like to try it out. ### NestJS Currently in beta testing. Please get in touch if you'd like to try it out.