Skip to content

NestWebhookRequest — @gj-kit/toss-payments-nestjs

A public type from @gj-kit/toss-payments-nestjs. The signature below is taken directly from the 0.4.4 release declaration.

import { NestWebhookRequest } from '@gj-kit/toss-payments-nestjs';
/**
* toNestWebhookHandler — Nest 컨트롤러에서 코어 웹훅 어댑터를 rawBody 강제와 함께
* 사용하는 헬퍼 (설계 §4.2, G9).
*
* Nest의 기본 body-parser가 JSON을 선파싱하면 서명/secret 검증이 전멸한다 — 이 헬퍼는
* `NestFactory.create(AppModule, { rawBody: true })` 전제로 `req.rawBody`만 신뢰하고,
* 부재 시 핸들러를 실행하지 않고 **명시적 500 + 설정 안내 로그**를 남긴다(조용한 검증
* 전멸 방지 — 400 응답이 반복되며 원인을 못 찾는 사고를 차단).
*/
/**
* Express/Fastify의 IncomingMessage와 구조 호환인 최소 요청 형태 —
* 코어의 NodeIncomingMessageLike(구조적 타입)를 재사용해 `node:http` 타입 결합을 피한다.
* `RawBodyRequest<Request>`(Express)·`RawBodyRequest<FastifyRequest['raw']>` 모두 충족.
*/
type NestWebhookRequest = RawBodyRequest<NodeIncomingMessageLike>;

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/toss-payments-nestjs
  • Version: 0.4.4
  • Public entry: .
  • Source: GitHub