How to connect Forge module to existing Connect App?

I am following the docs How to adopt Forge from Connect to use Forge module in Connect App. However, I am having problem that when developing locally, Connect App will automatically generate 1 ngrok url.

How can I set the baseUrl of Remote in Forge with each ngrok url automatically generated when running Connect App locally ?
Screenshot 2024-08-29 at 21.58.06
Thanks!

Hi @HungTran

I use an environment variable so that locally I can use a ngrok url, but on CI I can use staging or production as baseurl

remotes:
- key: remote-backend
  baseUrl: "https://${REMOTE_BACKEND_ENDPOINT}"
  operations:
  - compute
  - fetch
  auth:
    appSystemToken:
      enabled: true

@markrekveld
Thanks for your reply and sorry for the slow response.

I also want to use environment variables but when I start Connect App locally, ngrok will automatically generate the link and I can’t get it to update the manifest file of Forge.

When I dig into the docs of this section, I feel like it is a doc for converting the entire Connect app to Forge.

I currently only want to use 1 module of Forge in 1 Connect App and don’t want to convert the whole thing to Forge. Do you have any use cases or reference links for this section?

Thanks for your help
Best Regards
Hung

Hi @HungTran

No worries, here is the, link to the environment variable docs https://developer.atlassian.com/platform/forge/manifest-reference/environment/

The connect app is probably not going to update the Forge manifest, but what you can do is start the connect app locally, and once it is loaded, update the environment variable with the new ngrok url.
And then simply redeploy the Forge app to your development environment. It will then use the new ngrok url for your connect remote.

So save on time, you could look into getting a ngrok reserved domain then you can configure your connect app to use that specific url and you don’t need to update the environment variable every time and do a redeploy of the Forge app.

2 Likes