Is it possible to do an external api call within cloudcannon and save the data within cloudcannon?
I don’t think you can do it within the CloudCannon UI itself, but you can do things like fetch data as part of the prebuild
script/build hook. I’m guessing if you do download any data into your site folder as part of that prebuild process, CloudCannon will then have that data available to save back to your git repo as a change?
Yep! Within the build environment you’re free to fetch any data you want.
CloudCannon won’t save anything from your build process back to your git repo by default, but this is something you can configure using the SYNC_PATHS environment variable.
That documentation page mentions configuring it with a fixed environment variable, but this can also be set from within the build environment. For example, your prebuild
script can download data, and then export the SYNC_PATHS
environment variable to include the modified path. At the end of your build, CloudCannon will then commit those files back to your source repository if modified.