Skip to content

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

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

import { toNestWebhookHandler } from '@gj-kit/toss-payments-nestjs';
/**
* 컨트롤러 사용 (설계 §4.4):
* ```ts
* @Post('webhooks/toss')
* async handle(@Req() req: RawBodyRequest<Request>, @Res() res: Response) {
* await toNestWebhookHandler(verifier, handlers)(req, res);
* }
* ```
*
* 위임 구조: rawBody 확보만 이 헬퍼가 소유하고, 검증·dedupe·200 ack·autoRefetch
* prefetch·핸들러 디스패치는 전부 코어 `verifier.nodeHandler`에 위임한다 — 로직 중복 0.
*/
declare function toNestWebhookHandler(verifier: WebhookVerifier, handlers: WebhookHandlers, options?: NestWebhookHandlerOptions): (req: NestWebhookRequest, res: NodeServerResponseLike) => Promise<void>;

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