Lift The Source of Truth Up

Source is a library that allows you to generate request handlers from various sources, like HAR files or OpenAPI documents.

1

Take your truth

Record your traffic in the browser or take an OpenAPI specification as the source of truth.

2

Generate request handlers

Provide the supported input to @mswjs/source and get the list of request handlers back.

  
    
      import
       { fromTraffic } 
      from 
      '@mswjs/source/traffic'
    
    
      import
       traffic 
      from 
      './recording.har'
    
     
    
      const
       
      handlers
       
      =
       
      fromTraffic
      (traffic)
    
  
3

Integrate anywhere

Integrate with Mock Service Worker to achieve reliable network reproductions anywhere, anytime.

Source logo

Try out Source

Source is a useful tool to replay the recorded network traffic when mocking or debugging.

Get started