Shopify app proxy not working without react router

I am currently working on Theme App Extensions.

I need to send requests to my API, therefore i want to integrate the Shopify App Proxy for authentication, but i am facing difficulties.

The only response i get is an 404.

App configuration:
shopify.app.toml

[app_proxy]
url = "/proxy_route/settings"
subpath = "giftr-settings"
prefix = "apps"

I have also checked the proxy configuration in the app dev dashboard and the App-Proxy-URL path in the store admin

Dev Dashboard:
url: https:///proxy_route/settings
subpath: giftr-settings
prefix: apps

Store Admin:
https:///apps/giftr-settings

The issue persists in dev-mode and after i deploy the app to the Dev-Dashboard. The only thing i cannot test if this also happens in the “live” app, which is not in the Dev-Dashoard

All other threads with “app proxy not working in dev app” got resolved, so i do not think i face this problem.
But this one concerns me a little bit…
i was following the official doc (“linked below”) it mentions that i need an react router app.
Unfortunately my app runs with Nextjs.

Could this be my problem? If so, are there any workarounds, fixes i can make? (Besides changing the codebase to react router?

Looking forward to any responses.

Cheers

Hi @Lukas_Kien

If you’re not using the React Router template, then you can build your own authentication for app proxies, see docs here:

What could be happening here is that when someone visits:

https://your-store.myshopify.com/apps/giftr-settings

Shopify proxies to:

https://<your-app-url>/proxy_route/settings

and the 404 you’re seeing suggests this route doesn’t exist in your Next.js app.

So you’ll want to create the API route in Next.js and also make sure your shopify.app.toml file includes the write_app_proxy scope, as shown here:

Hope this helps!

Hey @Liam-Shopify

Thanks for the quick response

This helped a lot, Authenticate app proxies

now my proxy works as indended,

thanks for the help!

1 Like

Great to hear this is working for you - best of luck with the rest of your project Lukas and let us know if you hit any other issues :slight_smile: