This method works only with Server Side Rendering and it's a centralized source.
If you're using Next.js to build your app, you can use Vercel to deploy your app and then, use the provided app URL to feed the externalAppUrl
while preparing a new BOS Component.