How to call API when App is install in remix CLI

Hello

In the remix, how do we find an event or where we can integrate our third-party API which calls when App is installed on the shop?

Thank you

I’m trying to do something very similar. Did you figure this?

Currently, I have added my script inside “afterAuth” hook in shopify.server

I have tried with afterAuth but it’s working only the first time, if we restart npm dev then sometimes it’s not working.

It fires on app install and "when an access token expires." (reference) So you would need to either uninstall and reinstall your development app or run: npm run shopify app dev --reset

Also, make sure anything you are doing in afterAuth checks to make sure it doesn’t duplicate itself, like adding script tags, etc, because AFAIK afterAuth runs at least twice when installing an app (at least in development) and arbitrarily when accessTokens expire or are regenerated… Not only when the app is installed.