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•11mo ago
Message Not Public
Sign In & Join Server To View
Thx I’ll check it out soon
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.
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
You should use await reply.redirect("someURL")
Yes, how do i get the admin shopify app url for a custom app
Where in the admin/app do you want to bring the user?
The original page, or i guess shopify admin/my app/settings
Just navigate to your app from from the admin and copy that URL structure
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
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