Great Video! In this tutorial you have imported the collection 'store' which already exists. Can you please give me a hint on how to create a new collection programmatically from the app? Would appreciate your help :)
Hey! Thanks for watching. And, yes here's how. You can use the "app installed event" and listen for that, then use the data SDK to create a new collection. Here's the relevant docs how to generate events from CLI: dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-[…]ons/backend-extensions/events/add-event-extensions-with-the-cli that's the event you want ("on app installed"): dev.wix.com/docs/sdk/backend-modules/app-management/app-instances/on-app-instance-installed and that's the sdk method to create a collection: dev.wix.com/docs/sdk/backend-modules/data/collections/create-data-collection
Hi, I encountered the following error: "Oh no, it seems like the CLI encountered an unexpected error: Invalid URL." Could this be happening because I selected "Create a new Development Site" and the development site hasn’t been published yet?
Hi, the best place to ask you be in Discord in the apps-with-cli channel so the team there can problem solve with you i fyou are still having issues discord.gg/gJ6nUBhw
Great Video! In this tutorial you have imported the collection 'store' which already exists.
Can you please give me a hint on how to create a new collection programmatically from the app?
Would appreciate your help :)
Hey! Thanks for watching. And, yes here's how. You can use the "app installed event" and listen for that, then use the data SDK to create a new collection. Here's the relevant docs how to generate events from CLI:
dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-[…]ons/backend-extensions/events/add-event-extensions-with-the-cli that's the event you want ("on app installed"):
dev.wix.com/docs/sdk/backend-modules/app-management/app-instances/on-app-instance-installed and that's the sdk method to create a collection:
dev.wix.com/docs/sdk/backend-modules/data/collections/create-data-collection
Can you share the final code? There are some parts in which you paste code, so I cannot follow along.
I agree. The final code should be in a github repo.
Asking this instructors, will follow up
Hi,
I encountered the following error:
"Oh no, it seems like the CLI encountered an unexpected error: Invalid URL."
Could this be happening because I selected "Create a new Development Site" and the development site hasn’t been published yet?
I had the same problem. I fixed it with "npm i @wix/cli@latest @wix/cli-app@latest"
Hi, the best place to ask you be in Discord in the apps-with-cli channel so the team there can problem solve with you i fyou are still having issues discord.gg/gJ6nUBhw
yes! great tip - thanks for sharing