A minimal template repo for creating ZCLI Apps in Zendesk using Astro. Astro lets you bring your own front-end framework or no framework at all.
There are custom dev and build scripts in the scripts folder that you can use but they may need adjusted for your specific app/environment.
You can run them with bun dev:auto and bun build:auto
There is a branch called garden that has React and Zendesk Garden set up if you'd like to use those. This main branch is kept minimal and framework agnostic.
The Dev workflow leverages Astro's Dev mode.
- Run
bun devor your runtime equivalent to start the dev server - By default Astro runs on
http://localhost:4321/ - Update the
app/manifest.jsonfile with your dev server URL- You will need to update file paths for all of your app locations
- For example
/assets/index.htmlwill be replaced withhttp://localhost:4321/index.html
- Run
zcli apps:serverto start the zcli server - Do your development stuff
- When you are completed, change your URLs in
app/manifest.jsonback to file paths
To make sure your bundled assets will be loaded properly in production, you will need to provide Astro with your installation ID
- Use
zcli login -ito authenticate with your desired Zendesk instance - Run
zcli apps:createto deploy your app to Zendesk. - You should receive an
app_idin the terminal from ZCLI.- It can also be found in the file at
app/zcli.apps.config.json
- It can also be found in the file at
- Update the
astro.config.mjsfile to use your installation ID- You will want to update the
assetsPrefixvalue from/0/assets/ - If your ID is
112233for example, you will change it to/112233/assets
- You will want to update the
- Make sure your
app/manifest.jsonis updated and not using localhost. - Rebuild your app with
bun run buildor your runtime equivalent - Run
zcli apps:updateto update your deployed app. - In the future you can skip steps 1-4 as long as you are deploying to the same instance.