1
0
Fork 0
mirror of synced 2024-08-14 17:42:01 +12:00
budibase/packages/worker/src/utilities/configs.ts

27 lines
674 B
TypeScript

import * as pro from "@budibase/pro"
export async function getLicensedConfig() {
let licensedConfig: object = {}
const defaults = {
emailBrandingEnabled: true,
testimonialsEnabled: true,
platformTitle: undefined,
metaDescription: undefined,
loginHeading: undefined,
loginButton: undefined,
metaImageUrl: undefined,
metaTitle: undefined,
}
try {
// License/Feature Checks
const enabled = await pro.features.isBrandingEnabled()
if (!enabled) {
licensedConfig = { ...defaults }
}
} catch (e) {
licensedConfig = { ...defaults }
console.info("Could not retrieve license", e)
}
return licensedConfig
}