Registry / security / capacitor-cors-bypass-enhanced

capacitor-cors-bypass-enhanced

JSON →
library2.1.4jsnpmunverified

A comprehensive Capacitor plugin version 2.1.4 that provides advanced networking capabilities including CORS bypass, HTTP/2, HTTP/3 (planned), gRPC, GraphQL, WebSocket with auto-reconnect, SSE, file operations with progress tracking, and MCP (Model Context Protocol) support. It offers connection pooling, batch requests, smart caching, and network monitoring. Ships TypeScript definitions. Peer dependencies include @capacitor/core >=7.0.0 and @modelcontextprotocol/sdk ^1.0.0. Released under MIT license. Differentiators: modular TypeScript architecture, broad protocol support, and integrated AI communication protocol (MCP) with StreamableHTTP transport.

npm install capacitor-cors-bypass-enhanced
INSTALL
IMPORT
SIG · CAPACITOR-CORS-BYP
C
capacitor-cors-bypass-enhanced
securityjavascriptv2.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CorsBypass
import { CorsBypass } from 'capacitor-cors-bypass-enhanced'
import CorsBypass from 'capacitor-cors-bypass-enhanced'
Named export, not default. TypeScript definitions included.
makeRequest
CorsBypass.makeRequest({...})
CorsBypass.make_request({...})
Method uses camelCase. Returns an object with success, data, duration.
get
const response = await CorsBypass.get({url, ...})
CorsBypass.GET({...})
Alias method for HTTP GET. Returns response with protocolVersion and metrics.

Demonstrates a basic CORS-bypassed GET request using the plugin's makeRequest method with error handling.

import { CorsBypass } from 'capacitor-cors-bypass-enhanced'; async function fetchData() { const response = await CorsBypass.makeRequest({ url: 'https://api.example.com/data', method: 'GET', headers: { 'Authorization': 'Bearer ' + (process.env.AUTH_TOKEN ?? '') } }); if (response.success) { console.log('Data:', response.data); console.log('Duration:', response.duration + 'ms'); } else { console.error('Error:', response.error); } } fetchData();
Debug
Known issues
gotchaHTTP/3 (QUIC) is only partially available on Android via Cronet integration; iOS support is not yet implemented.
fix
Use protocolConfig.http3.enabled: false on iOS. Fallback to HTTP/2 or HTTP/1.1.
affects: <=2.1.4
gotchaCORS bypass only works within Capacitor WebView; native app runtime required. Does not work in standard browser.
fix
Ensure code runs inside Capacitor app (not browser).
affects: *
deprecatedLegacy SSE transport is still supported but will be removed in a future major version; StreamableHTTP transport is recommended.
fix
Migrate to StreamableHTTP transport if using MCP features.
affects: >=2.0.0
breakingVersion 2.0.0 dropped support for @capacitor/core <7.0.0. Requires Capacitor 7 or later.
fix
Upgrade @capacitor/core to >=7.0.0.
affects: >=2.0.0 <3.0.0
gotchaNetwork Proxy feature requires app permissions and may be restricted on iOS (system proxy cannot be set). On Android, proxy configuration requires VPN permission.
fix
Check platform documentation for proxy limitations; consider using direct requests where proxy not available.
affects: >=2.0.0
gotchaBatch requests may fail if the total request count exceeds the internal pool limit (default 10).
fix
Increase pool size via options.batchConfig.maxConcurrent or process in smaller batches.
affects: >=1.0.0
Errors
Common errors & fixes
Uncaught (in promise) Error: protocolConfig.http3 is not supported on iOS
HTTP/3 (QUIC) is not supported on iOS in current version.
fix
Set protocolConfig.http3.enabled: false when on iOS.
Module not found: Error: Can't resolve 'capacitor-cors-bypass-enhanced'
Package not installed or not linked correctly.
fix
Run 'npm install capacitor-cors-bypass-enhanced' and 'npx cap sync' to link plugin.
TypeError: Cannot read properties of undefined (reading 'makeRequest')
Import used wrong syntax (default import instead of named import).
fix
Use 'import { CorsBypass } from 'capacitor-cors-bypass-enhanced''.
Capacitor is not loaded. Ensure 'deviceready' event has not fired?
Capacitor runtime not ready or plugin used in a non-Capacitor environment (e.g., browser).
fix
Wrap code in Capacitor.isPluginAvailable('CorsBypass') check or ensure running inside Capacitor WebView.
Upgrade
Version history
2.1.4latest on npm
Audit
Dependencies
@capacitor/corerequiredPeer dependency: required for Capacitor plugin functionality
@modelcontextprotocol/sdkoptionalPeer dependency: required for MCP (Model Context Protocol) support
Agent activity
45 hits · last 30 days
node
42
Bingbot
1
Resources