{"id":48091,"library":"grpc-web-client-bloombox","title":"grpc-web-client","description":"gRPC-Web client for browsers and Node.js (v0.6.0). Allows making gRPC-Web requests from JavaScript/TypeScript without a proxy. Requires google-protobuf and @types/google-protobuf as peer dependencies. Provides unary, server-streaming, and bidirectional streaming via three API functions. Custom fork by Bloombox. Release cadence: irregular. Unlike grpc-web from improbable-eng, this is a modified version with potential upstream changes.","status":"active","version":"0.6.0","language":"javascript","source_language":"en","source_url":"github.com/bloombox/grpc-web","tags":["javascript","grpc","grpc-web","protobuf","typescript","ts"],"install":[{"cmd":"npm install grpc-web-client-bloombox","lang":"bash","label":"npm"},{"cmd":"yarn add grpc-web-client-bloombox","lang":"bash","label":"yarn"},{"cmd":"pnpm add grpc-web-client-bloombox","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for protobuf classes","package":"google-protobuf","optional":false},{"reason":"peer dependency for TypeScript type definitions","package":"@types/google-protobuf","optional":true}],"imports":[{"note":"This is a named export, not default.","wrong":"import grpc from 'grpc-web-client'","symbol":"grpc","correct":"import { grpc } from 'grpc-web-client'"},{"note":"First argument is the service method descriptor, second is options object.","wrong":"grpc.unary({ request, host, onEnd })","symbol":"grpc.unary","correct":"grpc.unary(serviceMethod, options)"},{"note":"Same signature as unary.","wrong":"grpc.invoke(options)","symbol":"grpc.invoke","correct":"grpc.invoke(serviceMethod, options)"},{"note":"Missing second argument for host and transport.","wrong":"grpc.client(serviceMethod)","symbol":"grpc.client","correct":"grpc.client(serviceMethod, options)"}],"quickstart":{"code":"import { grpc } from 'grpc-web-client';\nimport { BookService } from './generated/proto/book_pb_service';\nimport { GetBookRequest } from './generated/proto/book_pb';\n\nconst getBookRequest = new GetBookRequest();\ngetBookRequest.setIsbn(60929871);\n\nconst host = 'https://mygrpc.example.com';\ngrpc.unary(BookService.GetBook, {\n  request: getBookRequest,\n  host: host,\n  onEnd: res => {\n    const { status, statusMessage, message } = res;\n    if (status === grpc.Code.OK && message) {\n      console.log('Book:', message.toObject());\n    } else {\n      console.error('Error:', statusMessage);\n    }\n  }\n});","lang":"typescript","description":"Demonstrates a unary gRPC-Web call using generated service and message classes."},"warnings":[{"fix":"npm install google-protobuf @types/google-protobuf","message":"Peer dependencies google-protobuf and @types/google-protobuf must be installed separately.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Correct: grpc.unary(ServiceMethod, options)","message":"All three functions (unary, invoke, client) require the service method descriptor as first argument, not just options.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use import { grpc } from 'grpc-web-client'","message":"The grpc object is a named export; default import will not work.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Always check request is not null before calling cancel.","message":"Cancellation returns undefined when called after completion.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'allow':14 'api':44 'bidirect':40 'bloombox':49 'browser':10 'cadenc':51 'chang':69 'client':4,8 'custom':46 'depend':33 'eng':60 'fork':47 'function':45 'googl':27 'google-protobuf':26 'grpc':2,6,17,55,71,73 'grpc-web':5,16,54,72 'grpc-web-client':1 'improb':59 'improbable-eng':58 'irregular':52 'javascript':70 'javascript/typescript':21 'make':15 'modifi':64 'node.js':12 'peer':32 'potenti':67 'protobuf':28,75 'provid':34 'proxi':24 'releas':50 'request':19 'requir':25 'server':37 'server-stream':36 'stream':38,41 'three':43 'ts':77 'types/google-protobuf':30 'typescript':76 'unari':35 'unlik':53 'upstream':68 'v0.6.0':13 'version':65 'via':42 'web':3,7,18,56,74 'without':22","created_at":"2026-06-07T16:54:52.794081+00:00","updated_at":"2026-06-07T16:54:52.794081+00:00","problems":[{"fix":"Ensure you import the generated _pb_service file and pass the correct method (e.g., BookService.GetBook).","cause":"Missing or incorrect first argument (service method descriptor) to unary/invoke/client.","error":"Uncaught TypeError: Cannot read properties of undefined (reading 'getDescriptor')"},{"fix":"Change import to: import { grpc } from 'grpc-web-client'","cause":"Default import used instead of named import { grpc }","error":"TypeError: grpc.unary is not a function"},{"fix":"Run: npm install google-protobuf @types/google-protobuf --save","cause":"Peer dependency not installed.","error":"Module not found: Can't resolve 'google-protobuf'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"github.com/bloombox/grpc-web","github":"github.com/bloombox/grpc-web","docs":null,"changelog":null,"pypi":null,"npm":"grpc-web-client-bloombox","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}