# ClassSerializerInterceptorOptions

**Kind:** Interface

**Source:** [`packages/common/serializer/class-serializer.interceptor.ts`](https://github.com/nestjs/nest/blob/master/packages/common/serializer/class-serializer.interceptor.ts#L27)

**Part of:** [Common](subsystem-packages-common)

`ClassSerializerInterceptorOptions` configures the transformer implementation used by NestJS's `ClassSerializerInterceptor`. Its `transformerPackage` field allows applications to provide a compatible serialization package, such as `class-transformer`, when customizing response serialization behavior.

## Properties

| Property | Type |
|---|---|
| `transformerPackage` | `TransformerPackage` |

## Diagram

```mermaid
graph LR
  A[Controller Response] --> B[ClassSerializerInterceptor]
  B --> C[ClassSerializerInterceptorOptions]
  C --> D[transformerPackage]
  D --> E[Transformer Package]
  E --> F[Serialized HTTP Response]
```

## Usage

```ts
import { ClassSerializerInterceptor } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import * as classTransformer from 'class-transformer';

const serializerOptions = {
  transformerPackage: classTransformer,
};

const serializerInterceptor = new ClassSerializerInterceptor(
  new Reflector(),
  serializerOptions,
);

// Register globally or apply with @UseInterceptors(serializerInterceptor).
```

## AI Coding Instructions

- Provide a `transformerPackage` implementation compatible with the APIs expected by `ClassSerializerInterceptor`.
- Use `class-transformer` as the standard package unless the application intentionally supplies an alternative compatible implementation.
- Ensure the configured package is installed and available at runtime; missing transformer dependencies can break response serialization.
- Apply the interceptor globally or at controller/route level when serialized DTO output is required.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Injected or called by (1)

- `ClassSerializerInterceptor` — `packages/common/serializer/class-serializer.interceptor.ts`:34
