full-monkey-19641
08/18/2023, 3:42 PMjs
configuration: {
schema: z.object({
supabaseUrl: z.string(),
supabaseAnonKey: z.string(),
}),
ui: {
supabaseAnonKey: {
title: "Supabase Anon Key",
},
supabaseUrl: {
title: "Supabase URL",
},
},
},
and in an action, input looks like this
js
getProfile: {
title: "Get Profile",
description: "Get profile from Supabase",
input: {
schema: z.object({
access_token: z.string(),
refresh_token: z.string(),
userId: z.string(),
}),
},
but when i try to use them in an action, botpress gives me errors
js
async getProfile({ ctx, input, logger }) {
console.log("getProfile");
console.log("input", input);
const { configuration } = ctx.configuration;
const { supabaseAnonKey, supabaseUrl } = configuration;
const { access_token, refresh_token, userId } = input;
errors:
bash
TypeError: Cannot destructure property 'supabaseAnonKey' of 'i' as it is undefined.
at getProfile (/var/task/customer_code.js:29:39107)
at xe (/var/task/customer_code.js:8:84520)
at /var/task/customer_code.js:8:82656
at /var/task/index.js:20:13517
at AsyncLocalStorage.run (node:async_hooks:338:14)
at handleHTTPEvent (/var/task/index.js:20:13496)
at Runtime.handler (/var/task/index.js:20:13391)
at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1083:29)
i've defined them in integration config as well, also the variables set from dashboard doesnt pass to it