Skip to content

Tenant API Reference

Tenant Enum

ts
enum Tenant {
  App = 'app',
  Scholar = 'scholar',
}

TenantRouter

Constructor

ts
new TenantRouter(config: TenantRouterConfig)

TenantRouterConfig

속성타입설명
appHostnamestringApp 테넌트 hostname (예: 'https://app.liner.com')
scholarHostnamestringScholar 테넌트 hostname (예: 'https://scholar.liner.com')
gatewayLoggerTouchProductGatewayLoggertouch_product_gateway 이벤트용 로거

Methods

getUrl

테넌트의 전체 URL을 생성합니다.

ts
getUrl(target: Tenant, options?: TenantUrlOptions): string
파라미터타입설명
targetTenant대상 테넌트
optionsTenantUrlOptionsURL 옵션 (선택)

push

다른 테넌트로 이동합니다 (히스토리 추가).

ts
push(target: Tenant, options: TenantRoutingOptions): void
파라미터타입설명
targetTenant대상 테넌트
optionsTenantRoutingOptions라우팅 옵션 (필수)

replace

다른 테넌트로 이동합니다 (히스토리 교체).

ts
replace(target: Tenant, options: TenantRoutingOptions): void
파라미터타입설명
targetTenant대상 테넌트
optionsTenantRoutingOptions라우팅 옵션 (필수)

open

새 탭에서 다른 테넌트를 엽니다.

ts
open(target: Tenant, options: TenantRoutingOptions): void
파라미터타입설명
targetTenant대상 테넌트
optionsTenantRoutingOptions라우팅 옵션 (필수)

Types

TenantUrlOptions

ts
interface TenantUrlOptions {
  /** 이동할 경로 (기본값: '/') */
  path?: string;
  /** 쿼리 파라미터 */
  query?: Record<string, string | number | boolean | string[]>;
  /** 해시 */
  hash?: string;
}

TenantRoutingOptions

라우팅 메서드 (push, replace, open)에서 사용됩니다.

ts
interface TenantRoutingOptions extends TenantUrlOptions {
  /** touch_product_gateway 이벤트 로깅 파라미터 (필수) */
  gatewayLogParams: TouchProductGatewayLogParams;
}

TouchProductGatewayLogParams

ts
interface TouchProductGatewayLogParams {
  fromLinerProduct: 'ai_search' | 'scholar';
  fromLinerProductDetail: string | null;
  toLinerProduct: 'ai_search' | 'scholar';
  toLinerProductDetail: string | null;
  entryType: string;
  entryTypeDetail: string | null;
  componentType: 'button' | 'menu_button' | 'popup_button' | 'banner';
  uxWriting: string;
}

Released under the MIT License.