Mac9
Mac9
NNuxt
Created by Mac9 on 7/23/2024 in #❓・help
Issue accessing studio data within application
I have this it renders on https://nuxt.studio without any issues and I can alter the options, how do I access this object in my app? If I use const config = useAppConfig() it just gets the locally defined app config and doesn't access the details from the studio.
import { field, group } from "@nuxthq/studio/theme";

export default defineNuxtSchema({
appConfig: {
ui: group({
title: "UI Configuration",
description: "Configure the UI elements of your site.",
icon: "i-mdi-palette",
fields: {
logo: field({
type: "media",
title: "Logo",
description: "The main logo for your website.",
icon: "i-mdi-image",
}),
primaryColor: field({
type: "string",
title: "Primary Color",
description: "The primary color for your website's theme.",
icon: "i-mdi-palette",
default: "#3B82F6",
}),
backgroundColor: field({
type: "string",
title: "Background Color",
description: "The base/background color for your website.",
icon: "i-mdi-format-color-fill",
default: "#FFFFFF",
}),
},
}),
},
});
import { field, group } from "@nuxthq/studio/theme";

export default defineNuxtSchema({
appConfig: {
ui: group({
title: "UI Configuration",
description: "Configure the UI elements of your site.",
icon: "i-mdi-palette",
fields: {
logo: field({
type: "media",
title: "Logo",
description: "The main logo for your website.",
icon: "i-mdi-image",
}),
primaryColor: field({
type: "string",
title: "Primary Color",
description: "The primary color for your website's theme.",
icon: "i-mdi-palette",
default: "#3B82F6",
}),
backgroundColor: field({
type: "string",
title: "Background Color",
description: "The base/background color for your website.",
icon: "i-mdi-format-color-fill",
default: "#FFFFFF",
}),
},
}),
},
});
1 replies
NNuxt
Created by Mac9 on 7/23/2024 in #❓・help
Environment Variables are unusable but are able to be logged
I am trying to connect to a Supabase instance, I can run console.log on the environment variables and see the logs in the console are correct. However when I try to run createClient I recieve a 500: supabaseUrl is required error.
import { createClient } from "@supabase/supabase-js";

const { supabaseUrl, supabaseKey } = useRuntimeConfig();
console.log(supabaseUrl, supabaseKey)

const supabase = createClient(supabaseUrl, supabaseKey);
import { createClient } from "@supabase/supabase-js";

const { supabaseUrl, supabaseKey } = useRuntimeConfig();
console.log(supabaseUrl, supabaseKey)

const supabase = createClient(supabaseUrl, supabaseKey);
2 replies