@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
Section titled “Use it when”Use it when a Nest application needs to keep the core payment kit’s types and safety boundary through dependency injection.
Do not use it when
Section titled “Do not use it when”Do not reimplement payment verification in controllers or rely on parsed JSON when webhook verification requires raw bytes.
Golden path
Section titled “Golden path”Outcome: One Nest provider that injects a typed payment kit.
1. Install
Section titled “1. Install”pnpm add @gj-kit/toss-payments-nestjs2. Keep the app-owned boundary explicit
Section titled “2. Keep the app-owned boundary explicit”Build the core payment config, register it once, and preserve raw request bytes for webhook routes.
3. Start with the smallest integration
Section titled “3. Start with the smallest integration”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);Runtime and peers
Section titled “Runtime and peers”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 |
Public subpaths
Section titled “Public subpaths”| Entry | Exported symbols |
|---|---|
Root entry |
14 |
Safety boundary
Section titled “Safety boundary”Preserve raw request bytes for verified webhooks and make every store dependency explicit in the host Nest module.
API reference
Section titled “API reference”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.