{"id":18193,"library":"capacitor-stream-http","title":"Capacitor Stream HTTP","description":"Capacitor plugin for native HTTP streaming on iOS and Android, version 0.1.0. Enables true chunk-by-chunk streaming for Server-Sent Events (SSE) and other streaming APIs, with support for custom headers, request body, and cancellation. Differentiates from standard fetch by leveraging native URLSession (iOS) and HttpURLConnection (Android) for efficient streaming that works behind proxy configurations on mobile devices. Does not support web platform; falls back to fetch API. Maintained by chatbox, licensed MIT.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/chatbox/capacitor-stream-http","tags":["javascript","capacitor","plugin","native","http","streaming","typescript"],"install":[{"cmd":"npm install capacitor-stream-http","lang":"bash","label":"npm"},{"cmd":"yarn add capacitor-stream-http","lang":"bash","label":"yarn"},{"cmd":"pnpm add capacitor-stream-http","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Depends on Capacitor runtime for plugin lifecycle and native bridge communication","package":"@capacitor/core","optional":false}],"imports":[{"note":"Default export is not provided; use named import for the plugin object.","wrong":"import StreamHttp from 'capacitor-stream-http'","symbol":"StreamHttp","correct":"import { StreamHttp } from 'capacitor-stream-http'"},{"note":"Do not reference internal paths; use the package top-level export.","wrong":"import { createNativeReadableStream } from 'capacitor-stream-http/src/index'","symbol":"createNativeReadableStream","correct":"import { createNativeReadableStream } from 'capacitor-stream-http'"},{"note":"Type import for Capacitor plugin type declarations; available since v0.1.0.","wrong":null,"symbol":"StreamHttpPlugin","correct":"import type { StreamHttpPlugin } from 'capacitor-stream-http'"}],"quickstart":{"code":"import { StreamHttp } from 'capacitor-stream-http';\n\n// Listen for chunks\nawait StreamHttp.addListener('chunk', (data) => {\n  console.log('Received chunk:', data.chunk);\n});\n\n// Start streaming\nconst { id } = await StreamHttp.startStream({\n  url: 'https://api.example.com/stream',\n  method: 'GET',\n});\n\n// After some time, cancel the stream\nsetTimeout(async () => {\n  await StreamHttp.cancelStream({ id });\n}, 5000);","lang":"typescript","description":"Demonstrates how to listen for chunk events, start a GET stream, and cancel it after 5 seconds."},"warnings":[{"fix":"Check if running on native platform before using this plugin, or fall back to fetch/ReadableStream for web.","message":"Not supported on web platform; web builds will throw an error or silently fail.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"N/A","message":"No deprecations yet.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Always destructure { id } from the result.","message":"The startStream method returns an object with an 'id' property; you must store this ID to cancel the stream later.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Store listener references and call removeAllListeners or removeListener when done.","message":"Event listeners (addListener) must be removed to prevent memory leaks; the plugin does not auto-remove them.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use feature detection: if (Capacitor.getPlatform() !== 'web') { /* use plugin */ } else { /* fallback to fetch */ }","cause":"Using the plugin in a web (browser) environment where native APIs are not available.","error":"Error: Unsupported platform web"},{"fix":"Change to: import { StreamHttp } from 'capacitor-stream-http'","cause":"Incorrect import: using default import instead of named import.","error":"TypeError: StreamHttp.startStream is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}