Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@postman/postman-sdk

Package Overview
Dependencies
Maintainers
349
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@postman/postman-sdk

This SDK instrument express/sails app using OpenTelemetry. It captures the http request/response and uses them for auto-generating accurate postman collections

  • 0.0.41
  • npm
  • Socket score

Version published
Weekly downloads
65
decreased by-8.45%
Maintainers
349
Weekly downloads
 
Created
Source

About

This SDK instrument express/sails app using OpenTelemetry. It captures the http request/response and uses them for auto-generating accurate postman collections

Installation

npm install @postman/postman-sdk

At the top of your app.js file, before app is initialized add this.

initialize({
  collectionId: 'postman-collection-id'
  apiKey: '<your-postman-api-key>'
});

Configuration

SDK's initialization can be configured with these values

  • collectionId: Postman collectionId where requests will be added.
    • type: string
  • apiKey: Postman api key needed for collector
    • type: string
  • receiverBaseUrl: Where the data should be shipped to collector's http endpoint.
    • type: string(valid url)
    • default: 'https://api.getpostman-beta.com' , if using default please connect to postman VPN
  • bufferIntervalInMilliseconds: Time interval for data queueing. Export is triggered after every interval.
    • type: number
    • default: 5000
  • enable: enable or disable tracing.
    • type: boolean
  • debug: Enable debug logger
    • type: boolean
  • dataTruncation: Changes data in request/response body from {key: value} to {key: { type: typeof(value) } }
    • type: boolean
    • default: false
  • environment: Instrumentation environment development/prod etc. ( implementation TO-DO)
    • type: string
  • configFilePath: Path to config YAML file.
    • type: string
  • dataRedactions: Regex rules to redact data from requests.
    • type: { rules: { ruleName: ''}}
    Example
    initialize(
      collectionId: '<postmanCollectionId>'
      apiKey: '<apiKey>',
      dataRedaction: { rules: {
        apiToken: 'PMAK-[a-f0-9]' // Sample rule, you can add your own regex
      }}
    )
    
  • ignoreIncomingRequests: Apply logic on requests to ignore them from Live Collection
    Example
    initialize({
      ...otherParams,
      ignoreIncomingRequests: (request) => {
        return request.url.includes('knockknock')
      }
    })
    
  • ignoreOutgoingingRequests: Apply logic on requests to ignore them from Live Collection
    Example
    initialize({
      ...otherParams,
      ignoreOutgoingRequests: (request) => {
        return request.headers['User-Agent'].includes('ignoreme')
      }
    })
    

FAQs

Package last updated on 08 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc