<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh" -->

---
title: What are Interceptors in NestJS? | daily.dev
description: NestJS interceptors are wrappers around route handlers that execute logic both before and after a controller processes a request. They are ideal for...
canonical: https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What are Interceptors in NestJS? | daily.dev
og:description: NestJS interceptors are wrappers around route handlers that execute logic both before and after a controller processes a request. They are ideal for...
og:url: https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh
og:image: https://api.daily.dev/og/posts/Xbdv23kkH.png
og:image:alt: What are Interceptors in NestJS?
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.

# What are Interceptors in NestJS?

**[JavaScript Mastery](https://daily.dev/sources/javascriptmastery)** · 1 min read · 1 upvotes · 0 comments

## Summary

NestJS interceptors are wrappers around route handlers that execute logic both before and after a controller processes a request. They are ideal for transforming responses before they reach the client, making them well-suited for standardizing success responses with consistent data and metadata structures across an entire application.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=ZryPfcnSsDg>

## Questions this post answers

### What is an interceptor in NestJS and what is it used for?

An interceptor in NestJS is a wrapper around a route handler that runs logic before the controller executes and after it returns data, letting you transform the response before it reaches the client. Because interceptors deal with results rather than errors, they are commonly used to shape a consistent success response containing both data and metadata.

_Building consistent API responses in NestJS gets easier with guidance developers share on daily.dev._

## Similar posts on daily.dev

- [Intro to Nest.js: Server-side JavaScript development on Node](https://daily.dev/posts/intro-to-nest-js-server-side-javascript-development-on-node-2bm9sgdhw) · InfoWorld · 10 upvotes · 0 comments
- [Action Interceptors](https://daily.dev/posts/action-interceptors-d0mrc4x8n) · Larablog · 0 upvotes · 0 comments
- [Why Do We Need Nest.js When Node.js Already Exists?](https://daily.dev/posts/why-do-we-need-nest-js-when-node-js-already-exists--xoezfuya1) · Medium · 2 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#typescript](https://daily.dev/tags/typescript), [#nestjs](https://daily.dev/tags/nestjs)

[View this post on daily.dev](https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh)

```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":"What are Interceptors in NestJS?","url":"https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh"},"datePublished":"2026-07-13T11:50:22.813Z","dateModified":"2026-09-14T09:03:55.834Z","description":"NestJS interceptors are wrappers around route handlers that execute logic both before and after a controller processes a request. They are ideal for...","image":"https://i.ytimg.com/vi/ZryPfcnSsDg/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/ZryPfcnSsDg/sddefault.jpg","isAccessibleForFree":true,"articleSection":"JavaScript Mastery","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":"JavaScript Mastery","logo":"https://media.daily.dev/image/upload/s--i6Ls5Q5_--/f_auto/v1724338715/logos/javascriptmastery","url":"https://daily.dev/sources/javascriptmastery"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,typescript,nestjs","timeRequired":"PT1M","video":{"@type":"VideoObject","name":"What are Interceptors in NestJS?","description":"NestJS interceptors are wrappers around route handlers that execute logic both before and after a controller processes a request. They are ideal for...","thumbnailUrl":"https://i.ytimg.com/vi/ZryPfcnSsDg/sddefault.jpg","uploadDate":"2026-07-13T11:50:22.813Z","duration":"PT1M","url":"https://api.daily.dev/r/Xbdv23kkH","embedUrl":"https://www.youtube.com/embed/ZryPfcnSsDg"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JavaScript Mastery","item":"https://daily.dev/sources/javascriptmastery"},{"@type":"ListItem","position":3,"name":"What are Interceptors in NestJS?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/what-are-interceptors-in-nestjs--xbdv23kkh#faq","mainEntity":[{"@type":"Question","name":"What is an interceptor in NestJS and what is it used for?","acceptedAnswer":{"@type":"Answer","text":"An interceptor in NestJS is a wrapper around a route handler that runs logic before the controller executes and after it returns data, letting you transform the response before it reaches the client. Because interceptors deal with results rather than errors, they are commonly used to shape a consistent success response containing both data and metadata. Building consistent API responses in NestJS gets easier with guidance developers share on daily.dev."}}]}
```

