Using different url for client and server

I am using vuejs for my app and nodejs for my server and both are hosted at different url like app.example.com and api.example.com when I am using authentication in my server it is redirecting to my app url and giving error “AppBridgeError.. INVALID_ORIGIN”. Please help me with this, I don’t even know that is it possible to use different url or not.

const shopify = shopifyApp({
api: {
apiKey: CLIENT_ID,
apiSecretKey: CLIENT_SECRET,
scopes: [SCOPES],
hostScheme: ‘https’,
hostName: ‘example.ngrok-free.app’
},
auth: {
path: ‘/auth’,
callbackPath: ‘/auth/callback’,
},
webhooks: {
path: ‘/webhook’,
},
});

app.get(shopify.config.auth.path, getRedirectURI);
app.get(
shopify.config.auth.callbackPath,
shopify.auth.callback(),
shopify.redirectToShopifyOrAppRoot(),
);