@loganbussey/xhr-intercept

1.0.0 • Public • Published

XHR Intercept

A small utility to intercept in-flight XHR requests and to change the URL before they are sent. Useful for modifying the API endpoint URLs of externally loaded tracking scripts if running your own proxy. E.g. @loganbussey/change-segment-metric-host

Installation & Usage

NPM

$ npm install @loganbussey/xhr-intercept --save

import xhrIntercept from '@loganbussey/xhr-intercept';

xhrIntercept('api.foo.com', 'api.bar.com');

Readme

Keywords

Package Sidebar

Install

npm i @loganbussey/xhr-intercept

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.84 kB

Total Files

8

Last publish

Collaborators

  • lukebussey