It looks like your last action caused an issue on our side. We
- apologize for
- the
- inconvenience.
+
+
diff --git a/client/pages/register.vue b/client/pages/register.vue
index 9e9d589c4..789de5510 100644
--- a/client/pages/register.vue
+++ b/client/pages/register.vue
@@ -13,7 +13,7 @@
+
-
+
workspacesStore.getCurrent)
-const customDomainsEnabled = computed(
- () => useRuntimeConfig().public.customDomainsEnabled,
-)
onMounted(() => {
fetchAllWorkspaces()
diff --git a/client/plugins/featureFlags.js b/client/plugins/featureFlags.js
new file mode 100644
index 000000000..35cbca2f3
--- /dev/null
+++ b/client/plugins/featureFlags.js
@@ -0,0 +1,9 @@
+import { useFeatureFlagsStore } from '~/stores/featureFlags'
+
+export default defineNuxtPlugin((nuxtApp) => {
+ const featureFlagsStore = useFeatureFlagsStore()
+
+ nuxtApp.provide('featureFlag', (key, defaultValue = false) => {
+ return featureFlagsStore.getFlag(key, defaultValue)
+ })
+})
\ No newline at end of file
diff --git a/client/runtimeConfig.js b/client/runtimeConfig.js
index 515971c1b..968a5f5f1 100644
--- a/client/runtimeConfig.js
+++ b/client/runtimeConfig.js
@@ -22,12 +22,8 @@ export default {
gtmCode: process.env.NUXT_PUBLIC_GTM_CODE || null,
amplitudeCode: process.env.NUXT_PUBLIC_AMPLITUDE_CODE || null,
crispWebsiteId: process.env.NUXT_PUBLIC_CRISP_WEBSITE_ID || null,
- aiFeaturesEnabled: parseBoolean(process.env.NUXT_PUBLIC_AI_FEATURES_ENABLED),
- s3Enabled: parseBoolean(process.env.NUXT_PUBLIC_S3_ENABLED),
- paidPlansEnabled: parseBoolean(process.env.NUXT_PUBLIC_PAID_PLANS_ENABLED),
- customDomainsEnabled: parseBoolean(process.env.NUXT_PUBLIC_CUSTOM_DOMAINS_ENABLED),
+
featureBaseOrganization: process.env.NUXT_PUBLIC_FEATURE_BASE_ORGANISATION || null,
- selfHosted: parseBoolean(process.env.NUXT_PUBLIC_SELF_HOSTED, true),
// Config within public will be also exposed to the client
SENTRY_DSN_PUBLIC: process.env.SENTRY_DSN_PUBLIC,
diff --git a/client/stores/app.js b/client/stores/app.js
index 93af44708..859cf3e16 100644
--- a/client/stores/app.js
+++ b/client/stores/app.js
@@ -21,10 +21,7 @@ export const useAppStore = defineStore("app", {
},
}),
getters: {
- paidPlansEnabled: () => useRuntimeConfig().public.paidPlansEnabled,
featureBaseEnabled: () => useRuntimeConfig().public.featureBaseOrganization !== null,
- selfHosted: () => useRuntimeConfig().public.selfHosted,
- aiFeaturesEnabled: () => useRuntimeConfig().public.aiFeaturesEnabled,
crispEnabled: () => useRuntimeConfig().public.crispWebsiteId !== null && useRuntimeConfig().public.crispWebsiteId !== '',
},
actions: {
diff --git a/client/stores/featureFlags.js b/client/stores/featureFlags.js
new file mode 100644
index 000000000..fa7ec6337
--- /dev/null
+++ b/client/stores/featureFlags.js
@@ -0,0 +1,24 @@
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+
+export const useFeatureFlagsStore = defineStore('feature_flags', () => {
+ const flags = ref({})
+
+ async function fetchFlags() {
+ try {
+ const { data } = await useOpnApi('/content/feature-flags')
+ flags.value = data.value
+ } catch (error) {
+ console.error('Failed to fetch feature flags:', error)
+ }
+ }
+
+ function getFlag(path, defaultValue = false) {
+ return path.split('.').reduce((acc, part) => {
+ if (acc === undefined) return defaultValue
+ return acc && acc[part] !== undefined ? acc[part] : defaultValue
+ }, flags.value)
+ }
+
+ return { flags, fetchFlags, getFlag }
+})
\ No newline at end of file
diff --git a/client/stores/form_integrations.js b/client/stores/form_integrations.js
index 659772859..3b749861f 100644
--- a/client/stores/form_integrations.js
+++ b/client/stores/form_integrations.js
@@ -10,15 +10,18 @@ export const useFormIntegrationsStore = defineStore("form_integrations", () => {
const availableIntegrations = computed(() => {
const user = useAuthStore().user
+ const featureFlagsStore = useFeatureFlagsStore()
if (!user) return integrations.value
const enrichedIntegrations = new Map()
for (const [key, integration] of integrations.value.entries()) {
- enrichedIntegrations.set(key, {
- ...integration,
- id: key,
- requires_subscription: !user.is_subscribed && integration.is_pro,
- })
+ if (featureFlagsStore.getFlag(`integrations.${key}`, true)) {
+ enrichedIntegrations.set(key, {
+ ...integration,
+ id: key,
+ requires_subscription: !user.is_subscribed && integration.is_pro,
+ })
+ }
}
return enrichedIntegrations