{"_id":"@emmveqz/grpc-web-native","_rev":"11-06bd61f9da21f73c47a39b476a3dc334","name":"@emmveqz/grpc-web-native","dist-tags":{"latest":"1.2.0"},"versions":{"1.1.6":{"name":"@emmveqz/grpc-web-native","version":"1.1.6","keywords":["grpc","grpc-web","grpc-client","grpc-stream","grpc-streaming","grpc-js","grpc-stream-client","protobuf","protocol-buffers"],"author":{"name":"Emmanuel V. Lopez"},"license":"ISC","_id":"@emmveqz/grpc-web-native@1.1.6","maintainers":[{"name":"emmveqz","email":"emmveqz@gmail.com"}],"homepage":"https://github.com/emmveqz/grpc-web-native#readme","bugs":{"url":"https://github.com/emmveqz/grpc-web-native/issues"},"bin":{"gen-web-client-protos":"dist/grpc-web-client-proto-generator.js"},"dist":{"shasum":"67b79eed483a3d0df62a9b2e4e482d218bf4f773","tarball":"https://registry.npmjs.org/@emmveqz/grpc-web-native/-/grpc-web-native-1.1.6.tgz","fileCount":42,"integrity":"sha512-HzfW4fIwYiLoGtp286mcC8magxSVo25LDQ+A+6PbMXHaVkb6SD+hggPau9W20YAyCZaCqlPuBffd3SLQnJiDLg==","signatures":[{"sig":"MEUCIQD+FM7HBxcWTuJ7rXSw/b2PYWpIoIg2SVfCuiMvRcMk0wIgTWza9Fqm9xLMRBn/O7q3+B1K+a0cp/TqptoEI2Piq2g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":113130},"main":"dist/grpc-web-client-proto-generator.js","types":"dist/grpc-web-client-proto-generator.d.ts","gitHead":"d103c8c0f319b04d75e3b8d4c9f576b9152a40a7","scripts":{"prepack":"npm run transpile-generator","transpile-generator":"npx tsc --build ./tsconfig.json","gen-web-client-protos":"node ./dist/grpc-web-client-proto-generator.js"},"_npmUser":{"name":"emmveqz","email":"emmveqz@gmail.com"},"repository":{"url":"git+ssh://git@github.com/emmveqz/grpc-web-native.git","type":"git"},"_npmVersion":"10.8.2","description":"Native gRPC client for web browser","directories":{},"_nodeVersion":"20.19.1","dependencies":{"protobufjs":"^7.4.0","protobufjs-cli":"^1.1.3"},"publishConfig":{"registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^4.9.5","@types/glob":"^7.2.0","@types/node":"^13.7.0"},"_npmOperationalInternal":{"tmp":"tmp/grpc-web-native_1.1.6_1746809072449_0.4986227373519838","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@emmveqz/grpc-web-native","version":"1.2.0","description":"Native gRPC client for web browser","main":"dist/grpc-web-client-proto-generator.js","types":"dist/grpc-web-client-proto-generator.d.ts","scripts":{"gen-web-client-protos":"node ./dist/grpc-web-client-proto-generator.js","prepack":"npm run transpile-generator","transpile-generator":"npx tsc --build ./tsconfig.json"},"bin":{"gen-web-client-protos":"dist/grpc-web-client-proto-generator.js"},"author":{"name":"Emmanuel V. Lopez"},"license":"ISC","homepage":"https://github.com/emmveqz/grpc-web-native#readme","repository":{"type":"git","url":"git+ssh://git@github.com/emmveqz/grpc-web-native.git"},"bugs":{"url":"https://github.com/emmveqz/grpc-web-native/issues"},"publishConfig":{"registry":"https://registry.npmjs.org"},"keywords":["grpc","grpc-web","grpc-client","grpc-stream","grpc-streaming","grpc-js","grpc-stream-client","protobuf","protocol-buffers"],"dependencies":{"protobufjs":"^7.4.0","protobufjs-cli":"^1.1.3"},"devDependencies":{"@types/glob":"^7.2.0","@types/node":"^13.7.0","typescript":"^4.9.5"},"_id":"@emmveqz/grpc-web-native@1.2.0","gitHead":"7e9506cd67663143894c553348657525a782c400","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-6Le0FguHVx/MRwLghnsyrpTJvvS/NAOxz9If8T4DngzHtNQNSK8PJ/vyzszyp8GPPyqTCVETa/AfFiULqJ86Qg==","shasum":"6b68f4e2b62326feb82229918962fddae30640c8","tarball":"https://registry.npmjs.org/@emmveqz/grpc-web-native/-/grpc-web-native-1.2.0.tgz","fileCount":42,"unpackedSize":113424,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCZpzIaALn8pMdVlzc4Ud9sV1FweypGD0CEYBSp6spf9gIgLMDfs9OU3tJFfs9nInDGBDhCFS4qV/ncgWOn/HYJ3BA="}]},"_npmUser":{"name":"emmveqz","email":"emmveqz@gmail.com"},"directories":{},"maintainers":[{"name":"emmveqz","email":"emmveqz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/grpc-web-native_1.2.0_1759192474527_0.5229691388230806"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-09T16:44:32.339Z","modified":"2025-09-30T00:34:34.876Z","1.1.1":"2025-05-09T04:24:24.867Z","1.1.2":"2025-05-09T05:02:38.975Z","1.1.3":"2025-05-09T05:15:35.024Z","1.1.4":"2025-05-09T05:18:06.641Z","1.1.5":"2025-05-09T05:29:40.134Z","1.1.6":"2025-05-09T16:44:32.691Z","1.2.0":"2025-09-30T00:34:34.706Z"},"bugs":{"url":"https://github.com/emmveqz/grpc-web-native/issues"},"author":{"name":"Emmanuel V. Lopez"},"license":"ISC","homepage":"https://github.com/emmveqz/grpc-web-native#readme","keywords":["grpc","grpc-web","grpc-client","grpc-stream","grpc-streaming","grpc-js","grpc-stream-client","protobuf","protocol-buffers"],"repository":{"type":"git","url":"git+ssh://git@github.com/emmveqz/grpc-web-native.git"},"description":"Native gRPC client for web browser","maintainers":[{"name":"emmveqz","email":"emmveqz@gmail.com"}],"readme":"# gRPC Web Native\n\nToolchain to generate the client Javascript (Typescript) code for the browser from your `.proto` files,  \nusing [protobufjs](https://www.npmjs.com/package/protobufjs) as a core code generator, and [grpc-node-web](https://www.npmjs.com/package/@emmveqz/grpc-node-web) as the server implementation to follow.\n\n## Installation\n\nnpm package: [@emmveqz/grpc-web-native](https://www.npmjs.com/package/@emmveqz/grpc-web-native)\n\n```sh\nnpm install @emmveqz/grpc-web-native\n```\n\n## Usage\n\n```sh\nnpx gen-web-client-protos <protos_source> <output_folder>\n\n# e.g. for patterns: (mind the quote)\nnpx gen-web-client-protos './protos/*.proto' ./src/generated\n\n# e.g. for single file:\nnpx gen-web-client-protos ./protos/helloworld.proto ./src/generated\n\n# e.g. for ES6+ import style: (default is commonJS)\nnpx gen-web-client-protos './protos/*.proto' ./src/generated --import_style=esm\n```\n\nSee the [Example.tsx](./example/Example.tsx) for an example on how to use the generated code.\n\n## Proxy\n\nNone, hence the `native` suffix in the project's name.\n\n## Binary Support\n\nYes. Again, no proxy needed. Just using the original `Content-Type: application/grpc+proto`.  \nAnd taking advantage of browser native `ReadableStream` and `Uint8Array` to actually use bytes instead of text.  \n(Yes, even on streaming methods)\n\n## Streaming Support\n\nYes.\n\n - Request (Up) Streaming\n - Response (Down) Streaming\n - Bidi (Only half duplex, request streaming. Full duplex to be implemented yet)  \n   - As of now, since both request/response streaming are supported separately,  \n   if you need a full duplex method, you could split it in two methods, eg.:  \n   `service.upstreamVideo()` `service.downstreamVideo()`  \n   both request messages would need a common `UUID` parameter  \n   to identify the current process at both the server and client.\n\n## HTTP2 Support\n\nYes. Using the browser native `fetch` instead of `xhr` or `websockets`.  \nNo need to wait for `WebTransport` to be implemented and standardized in safari.  \nWhich also needs to be implemented to npm pkg @grpc/grpc-js (server).\n\n## Abort Support\n\nYes. Use the browser native `AbortController` to control/abort the http call.\n\n## Other Features\n\n - `Promise` style response\n - Typescript support\n - No need to install plugins (such as `protoc`)\n\n## CORS\n\nWhile using a NodeJS gRPC server implementation ([grpc-node-web](https://www.npmjs.com/package/@emmveqz/grpc-node-web)),  \nsuch as the one used at [example/server/src/index.ts](./example/server/src/index.ts) you will need to set your web browser origin, like so:\n\n```typescript\nimport * as grpc from '@emmveqz/grpc-node-web'\n\nconst grpcServer = new grpc.Server({\n  allowedOrigin: 'https://my-web-browser-app.com',\n})\n```\n\nFor gRPC server implementations in other languages, you will need to find the equivalent code,  \nor just setup a Proxy to defeat CORS (with a configuration to support HTTP2).  \nThe gRPC server will still need to be started with SSL certs in order to work with HTTP2.  \n(I'd think localhost is not allowed)\n","readmeFilename":"README.md"}