How to customize what happens after oauth and app installation has finished

Topic summary

Issue: After a Shopify app install, the OAuth callback route (/api/auth/callback) doesn’t appear to run—no console logs from the handler. The developer wants to create a new “store” entry in their database right after installation.

Setup described:

  • Auth config: path “/api/auth” and callbackPath “/api/auth/callback”.
  • Route in index.js: GET “/api/auth/callback” logs request/response, then redirects to “/”.
  • During install, no logs are printed, suggesting the callback isn’t being hit or logs aren’t visible.

Key guidance and questions:

  • Confirmed: Creating the store record in the OAuth callback handler is the correct approach.
  • Requested details to diagnose:
    • Was a Shopify app template used?
    • Which file contains the auth configuration?
    • What exactly happens after clicking “Install App” on the OAuth grant page?

Status: Unresolved. Next steps depend on clarifying the app setup and verifying whether the OAuth callback is actually being invoked after installation.

Summarized with AI on January 20. AI used: gpt-5.

Hi, I am writing an app that has a custom action to do after a store owner has installed my app to their store.
The configuration for auth looks like this:

auth: {
  path: "/api/auth",
  callbackPath: "/api/auth/callback",
}

In the index.js file, I created a new path and its behaviour like this:

app.get("/api/auth/callback", (_req, res) => {
  console.log('/api/auth/callback callback');
  console.log('_req: ', _req);
  console.log('res: ', res);
  res.redirect("/");
});

However, when I installed my app to a store, I don’t see _req and res being printed to the console. Am I missing something?

My goal is to create a new “store” entry in my database when a new store install the app. I thought doing it at the end of OAuth makes sense but not exactly sure how to do that.

Thanks!

It’s hard to know what’s wrong without more details about your setup. A few questions that would help shed more light on the issue:

  • Did you use one of the templates to build your app?
  • What file did you add the configuration for auth to?
  • When you run your app what happens after you click “Install App” on the OAuth Grant page?

Creating your store entry in the OAuth callback handler is the right place to do it.