mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-19 22:41:39 +02:00
14 lines
572 B
TypeScript
14 lines
572 B
TypeScript
import { getMetadata } from '@hcengineering/platform'
|
|
import presentation from '@hcengineering/presentation'
|
|
import { getClient as getBillingClientRaw, type BillingClient } from '@hcengineering/billing-client'
|
|
import billingPlugin from '@hcengineering/billing'
|
|
|
|
export function getBillingClient (): BillingClient | null {
|
|
const billingUrl = getMetadata(billingPlugin.metadata.BillingURL)
|
|
if (billingUrl === undefined || billingUrl === '') {
|
|
return null
|
|
}
|
|
const token = getMetadata(presentation.metadata.Token)
|
|
return getBillingClientRaw(billingUrl, token)
|
|
}
|