open-index/open-npm huggingface dataset:
npm package: @seoulcomix-hub/cli
Description: - Documentation in [`apps/web/src/routes/tools/hub-cli/cli-readme.md`](../../apps/web/src/routes/tools/hub-cli/cli-readme.md)
Author: Seoulcomix
Latest version: 0.0.6

# Seoulcomix hub CLI

- Documentation in [`apps/web/src/routes/tools/hub-cli/cli-readme.md`](../../apps/web/src/routes/tools/hub-cli/cli-readme.md)
npm package: @seoulcommerce/korea-checkout-sdk
Description: Browser SDK for SeoulCommerce Korea Checkout payment sessions and Inicis launch flows.
Latest version: 0.1.1

# @seoulcommerce/korea-checkout-sdk

Browser and application SDK for the SeoulCommerce Korea Checkout payment session flow.

This package gives merchants a small client for:

- creating payment sessions
- resolving launch contracts
- fetching Inicis launch payloads
- launching the Inicis browser flow
- polling for normalized terminal payment state

## Install

```bash
npm install @seoulcommerce/korea-checkout-sdk
```

## Quick Start

```ts
import {
  HttpPaymentSdkClient,
  prepareInicisPaymentFlow,
  launchInicisInBrowser,
  waitForTerminalResult,
} from '@seoulcommerce/korea-checkout-sdk'

const client = new HttpPaymentSdkClient('https://your-payment-api.example.com')

const { session, connectorLaunch } = await prepareInicisPaymentFlow(client, {
  merchantId: 'merchant-id',
  storeId: 'store-id',
  idempotencyKey: `checkout-${Date.now()}`,
  platform: {
    type: 'magento',
    cartId: 'masked-cart-id',
  },
  customer: {
    email: 'customer@example.com',
  },
  amount: {
    value: 1000,
    currency: 'KRW',
  },
  paymentSelection: {
    gateway: 'inicis',
    method: 'inipay_gateway',
  },
  returnUrls: {
    success: 'https://store.example.com/checkout/success',
    failure: 'https://store.example.com/checkout/failure',
    cancel: 'https://store.example.com/checkout/cancel',
  },
  device: {
    channel: 'web',
    isMobile: false,
    userAgent: navigator.userAgent,
  },
})

await launchInicisInBrowser(client, connectorLaunch)

const terminalResult = await waitForTerminalResult(client, session.paymentSessionId)
console.log(terminalResult)
```

## Main Exports

- `HttpPaymentSdkClient`
- `prepareInicisPaymentFlow()`
- `launchPaymentSession()`
- `pollPaymentSessionUntilTerminal()`
- `waitForTerminalResult()`
- `launchInicisInBrowser()`
- `installInicisBrowserHelpers()`
- `installInicisOverlayStyle()`
- `loadExternalScriptOnce()`

## Notes

- The SDK expects a SeoulCommerce payment API backend that implements the payment session and Inicis connector endpoints.
- `launchInicisInBrowser()` is intended for browser environments.
- The package includes its public request/response types, so consumers do not need a separate contracts package.