Skip to content

@gj-kit/toss-payments-nestjs

NestJS DI and raw-body webhook composition for @gj-kit/toss-payments.

Current npm latest: 0.4.4

Use it when a Nest application needs to keep the core payment kit’s types and safety boundary through dependency injection.

Do not reimplement payment verification in controllers or rely on parsed JSON when webhook verification requires raw bytes.

Outcome: One Nest provider that injects a typed payment kit.

Terminal window
pnpm add @gj-kit/toss-payments-nestjs

Build the core payment config, register it once, and preserve raw request bytes for webhook routes.

Copy this first, then replace only the app-owned values named above.

import { orThrow } from '@gj-kit/toss-payments';
import { defineTossPaymentsConfig, parseApiSecretKey } from '@gj-kit/toss-payments/server';
import { TossPaymentsModule } from '@gj-kit/toss-payments-nestjs';
declare const apiSecretFromEnv: string; // Read this once from your server environment.
const config = defineTossPaymentsConfig({
secretKey: orThrow(parseApiSecretKey(apiSecretFromEnv)),
});
export const payments = TossPaymentsModule.forRoot(config);

Engines: node >=20

Peer Supported range Required for
@gj-kit/toss-payments `^0.2.0
@nestjs/common `^10
reflect-metadata `^0.1.13
rxjs ^7 the package integration
Entry Exported symbols
Root entry 14

Preserve raw request bytes for verified webhooks and make every store dependency explicit in the host Nest module.

complete API reference contains every public function, class, type, constant, and error contract generated from release declarations. Each item shows its import path, release signature, and package version.

@gj-kit/toss-payments, @gj-kit/toss-payments-postgresql

npm · GitHub