@gj-kit/toss-payments-postgresql
PostgreSQL stores, migrations, inbox, and encryption seams for @gj-kit/toss-payments.
Current npm latest:
0.5.1
Use it when
Section titled “Use it when”Use it when Toss payment stores need a proven PostgreSQL implementation while your app retains connection lifecycle and key custody.
Do not use it when
Section titled “Do not use it when”Do not run migrations on request or application startup, and do not use the plaintext protector in production.
Golden path
Section titled “Golden path”Outcome: PostgreSQL-backed Toss stores with one explicit migration step.
1. Install
Section titled “1. Install”pnpm add @gj-kit/toss-payments-postgresql2. Keep the app-owned boundary explicit
Section titled “2. Keep the app-owned boundary explicit”Adapt your pool with fromPgPool, use a real encrypted sensitiveValueProtector, and run migration during deployment.
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 { createTossPaymentsPostgres, fromPgPool, type PgPoolLike, type SensitiveValueProtector } from '@gj-kit/toss-payments-postgresql';
declare const pool: PgPoolLike;declare const sensitiveValueProtector: SensitiveValueProtector; // App KMS/encryption boundary.
export const stores = createTossPaymentsPostgres({ sql: fromPgPool(pool), sensitiveValueProtector,});
// Run await stores.migrate() once in deployment, never per request.Runtime and peers
Section titled “Runtime and peers”Engines: node >=20
| Peer | Supported range | Required for |
|---|---|---|
@gj-kit/toss-payments |
`^0.5.0 | |
@nestjs/common |
`^10 | |
reflect-metadata |
`^0.1.13 | |
rxjs |
^7 |
documented optional subpaths only |
Public subpaths
Section titled “Public subpaths”| Entry | Exported symbols |
|---|---|
Root entry |
55 |
./nestjs |
14 |
./testing |
30 |
Safety boundary
Section titled “Safety boundary”Use an app-owned KMS or key-management boundary for sensitive values, run explicit migrations once, and keep cleanup operations idempotent.
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.