redirect_uri and custom app logic after app install and auth

are you using prisma?

if so run npx prsima studio. You should see the sessions. Inside your app.tsx file (I believe routes) you can see the loader function at the top and there you have access to admin and session. That file is called across all the pages. You can have logic there with Prisma to run something on install and save/call to Prisma to handle the state for new/existing apps.

with the authenticate function from Shopify (in the loader function), you have the session object which also has the store and access token.