shopify.auth.buildEmbeddedAppUrl

October 2, 2023 ยท View on GitHub

Constructs the redirection URL for getEmbeddedAppUrl based on the given host.

This utility relies on the host query param being a Base 64 encoded string. All requests from Shopify should include this param in the correct format.

Example

app.get('/redirect/endpoint', (req, res) => {
  const redirectURL = shopify.auth.buildEmbeddedAppUrl(req.query.host);

  res.redirect(redirectURL);
});

Parameters

host

string | :exclamation: required

The host parameter from the Shopify request.

Return

string

The appropriate Shopify address to redirect to.

Back to shopify.auth