Is there a way to redirect a user to within a shopify app page?

How can I modify a route in my Shopify app to dynamically redirect a user to the embedded app for their specific shop? For instance, if a user with shop ID 123 accesses the route, I want them to be redirected to the embedded app URL for that shop. Since it's a custom app, each shop may have a different app URL or handle. How can I achieve this?
11 Replies
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Jay
JayOP11mo ago
Thx I’ll check it out soon
Chocci_Milk
Chocci_Milk11mo ago
Could you please elaborate on your question? From where are you redirecting? Where do you want to redirect to, etc? The general answer is yes.
Jay
JayOP11mo ago
I am directing merchants to an external URL to verify something, and the external URL redirects the user to a gadget HTTP route and I need now to redirect the user back to the Shopify admin
Chocci_Milk
Chocci_Milk11mo ago
You should use await reply.redirect("someURL")
Jay
JayOP11mo ago
Yes, how do i get the admin shopify app url for a custom app
Chocci_Milk
Chocci_Milk11mo ago
Where in the admin/app do you want to bring the user?
Jay
JayOP11mo ago
The original page, or i guess shopify admin/my app/settings
Chocci_Milk
Chocci_Milk11mo ago
Just navigate to your app from from the admin and copy that URL structure
Jay
JayOP11mo ago
But its a custom app, and each install is a diff handle Is there a way to get the current app context based on a shop id? Or somehow get the app id
Chocci_Milk
Chocci_Milk11mo ago
Maybe via the connections object. You'd have to take a look. You might get the appId from the connections object. That could help you build the URL

Did you find this page helpful?