<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb" -->

---
title: Interceptors in gRPC-Web | daily.dev
description: gRPC-Web 1.1.0 adds support for interceptors, mirroring the client interceptor pattern used in other gRPC languages while adding gRPC-Web specific features. It...
canonical: https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Interceptors in gRPC-Web | daily.dev
og:description: gRPC-Web 1.1.0 adds support for interceptors, mirroring the client interceptor pattern used in other gRPC languages while adding gRPC-Web specific features. It...
og:url: https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb
og:image: https://api.daily.dev/og/posts/ONTlULAKB.png
og:image:alt: Interceptors in gRPC-Web
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Interceptors in gRPC-Web

**[gRPC Blog](https://daily.dev/sources/grpc-blog)** · 4 min read · 0 upvotes · 0 comments

## Summary

gRPC-Web 1.1.0 adds support for interceptors, mirroring the client interceptor pattern used in other gRPC languages while adding gRPC-Web specific features. It defines UnaryInterceptor and StreamInterceptor interfaces, each with an intercept() method that can modify requests before they're sent, manipulate invoker behavior (e.g., serving cached results), and update responses before returning them to the client. Code examples show how to implement a simple unary interceptor and a more involved stream interceptor using a ClientReadableStream wrapper class. Interceptors are bound to a client at instantiation via unaryInterceptors or streamInterceptors options, and execute in reverse order for requests and in order for responses.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://grpc.io/blog/grpc-web-interceptor>

## Questions this post answers

### How do I add an interceptor to gRPC-Web requests?

gRPC-Web 1.1.0 introduces UnaryInterceptor and StreamInterceptor interfaces, each requiring a single intercept(request, invoker) method. Implement the interface as a class, then bind instances to a client via the unaryInterceptors or streamInterceptors option when constructing the client (e.g., new MyServicePromiseClient(host, creds, {unaryInterceptors: [interceptor1]})). Interceptors can modify the request, response, or bypass the invoker entirely for caching.

_Track gRPC-Web releases like this on daily.dev before wiring interceptors into your client._

### What is the difference between UnaryInterceptor and StreamInterceptor in gRPC-Web?

UnaryInterceptor's intercept() method returns a Promise wrapping the RPC response, suited for single-response calls, while StreamInterceptor's intercept() returns a ClientReadableStream, used for server-streaming RPCs. A StreamInterceptor requires wrapping the ClientReadableStream to intercept events like 'data', 'status', 'end', and 'error', unlike the simpler Promise-based unary approach.

_daily.dev helps developers comparing gRPC streaming patterns keep up with framework changes._

### In what order do multiple gRPC-Web interceptors execute?

Multiple interceptors bound to a gRPC-Web client execute in reverse order for request processing and in normal order for response processing. This means the last interceptor in the array processes the outgoing request first is applied last, while its response handling runs first as the response returns to the caller.

_daily.dev keeps developers building interceptor chains current on gRPC-Web behavior._

## Similar posts on daily.dev

- [gRPC deep dive: from service definition to wire format](https://daily.dev/posts/grpc-deep-dive-from-service-definition-to-wire-format-mykdq3gjn) · Hacker News · 0 upvotes · 0 comments
- [What's New in the Qt GRPC library in 6.11](https://daily.dev/posts/what-s-new-in-the-qt-grpc-library-in-6-11-ds47nijle) · Qt · 0 upvotes · 0 comments
- [From RPC to gRPC: Understanding Remote Procedure Calls, Protocol Buffers, and Modern Distributed Systems Communication](https://daily.dev/posts/from-rpc-to-grpc-understanding-remote-procedure-calls-protocol-buffers-and-modern-distributed-sys-hdfydjpc0) · freeCodeCamp · 1 upvotes · 0 comments
- [gRPC-Web Failed the Web · Buf](https://daily.dev/posts/grpc-web-failed-the-web-buf-yxi6aoslo) · Buf Blog · 51 upvotes · 8 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#backend](https://daily.dev/tags/backend), [#grpc](https://daily.dev/tags/grpc)

[View this post on daily.dev](https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Interceptors in gRPC-Web","url":"https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb"},"datePublished":"2026-08-23T07:20:22.659Z","dateModified":"2026-08-23T07:23:06.007Z","description":"gRPC-Web 1.1.0 adds support for interceptors, mirroring the client interceptor pattern used in other gRPC languages while adding gRPC-Web specific features. It...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/10aae04dfd3ba4523d83e4087201877a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/10aae04dfd3ba4523d83e4087201877a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"gRPC Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"gRPC Blog","logo":"https://media.daily.dev/image/upload/s--asedGCAx--/f_auto,q_auto/v1787469607/logos/grpc-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/grpc-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,backend,grpc","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"gRPC Blog","item":"https://daily.dev/sources/grpc-blog"},{"@type":"ListItem","position":3,"name":"Interceptors in gRPC-Web"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/interceptors-in-grpc-web-ontlulakb#faq","mainEntity":[{"@type":"Question","name":"How do I add an interceptor to gRPC-Web requests?","acceptedAnswer":{"@type":"Answer","text":"gRPC-Web 1.1.0 introduces UnaryInterceptor and StreamInterceptor interfaces, each requiring a single intercept(request, invoker) method. Implement the interface as a class, then bind instances to a client via the unaryInterceptors or streamInterceptors option when constructing the client (e.g., new MyServicePromiseClient(host, creds, {unaryInterceptors: [interceptor1]})). Interceptors can modify the request, response, or bypass the invoker entirely for caching. Track gRPC-Web releases like this on daily.dev before wiring interceptors into your client."}},{"@type":"Question","name":"What is the difference between UnaryInterceptor and StreamInterceptor in gRPC-Web?","acceptedAnswer":{"@type":"Answer","text":"UnaryInterceptor's intercept() method returns a Promise wrapping the RPC response, suited for single-response calls, while StreamInterceptor's intercept() returns a ClientReadableStream, used for server-streaming RPCs. A StreamInterceptor requires wrapping the ClientReadableStream to intercept events like 'data', 'status', 'end', and 'error', unlike the simpler Promise-based unary approach. daily.dev helps developers comparing gRPC streaming patterns keep up with framework changes."}},{"@type":"Question","name":"In what order do multiple gRPC-Web interceptors execute?","acceptedAnswer":{"@type":"Answer","text":"Multiple interceptors bound to a gRPC-Web client execute in reverse order for request processing and in normal order for response processing. This means the last interceptor in the array processes the outgoing request first is applied last, while its response handling runs first as the response returns to the caller. daily.dev keeps developers building interceptor chains current on gRPC-Web behavior."}}]}
```

