Package Exports
- @apimatic/proxy
- @apimatic/proxy/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@apimatic/proxy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
APIMatic Proxy Libary for JavaScript
This library is currently in preview.
Provides utility functions to generate HTTP and HTTPS proxy agents based on configuration. It supports conditional behavior for both Node.js and browser environments.
The exported helper functions and interfaces include:
- createProxyAgents: Creates and returns HTTP and HTTPS proxy agents using provided proxy settings. In browser environments, this function returns undefined with a warning, as proxy agents are not supported in browsers.
- ProxySettings: Defines the proxy configuration, including a required address and optional port and authentication credentials.
This library is used by JavaScript SDKs generated by the APIMatic Code Generator.
Builds
The following environments are supported:
- Node.js v14+ and v16+
- Bundlers like Rollup or Webpack
- Web browsers
To support multiple environments, we export various builds:
| Environment | Usage |
|---|---|
| Common.js | Import like this: require('@apimatic/proxy'). |
| ES Module | Import like this: import { /* your imports */ } from '@apimatic/proxy'. |
| Browsers | *Use script: https://unpkg.com/@apimatic/proxy@VERSION/umd/schema.js |
| Modern Browsers (supports ESM and uses modern JS) | *Use script: https://unpkg.com/@apimatic/proxy@VERSION/umd/schema.esm.js |
* Don't forget to replace VERSION with the version number.
Note: We discourage importing files or modules directly from the package. These are likely to change in the future and should not be considered stable.