What are you trying to accomplish
I want to explore developing a data plugin
Screenshots or video link
Code stack you are integrating Builder with
NextJS
Reproducible code example
import { registerDataPlugin } from '@builder.io/data-plugin-tools';
registerDataPlugin({
id: "@example/plugin-dummy",
name: "lollenplugindummy",
settings: [],
ctaText: `plugin-dummy to test out functionality`,
getResourceTypes: async () => {
return [{
id: "alldogs",
name: "All dogs",
description: "Get a list of all dog breeds",
toUrl: (options: any) => {
return "https://dog.ceo/api/breeds/list/all"
},
canPickEntries: true,
inputs: () => []
}]
},
})
The above code when run throw a Cannot read properties of undefined (reading ‘organization’) error.
Suspecting the errors are from the rows referencing appState.user.organization (appState.user being undefined) in builder/index.ts at 395b715bf359b086a8d287b6be5aa172303bdd20 · BuilderIO/builder · GitHub
I therefore tried to import appState from @builder.io/app-context but it only gives me an empty object (which might explain the above error cause)
I have not been able to find any documentation to work around this issue other than possibly the license levels describing private plugins requiring enterprise license.
Worth mentioning, registering custom components and testing it out trough builder.io page builder works excellent, so the code is initialized correctly i believe.
Anyone got any advice?
Cheers!