Server-side logic

When a customer on a Wix site clicks on a link and requests a page, is it possible to send information about the current user to a 3rd party and determine server side which page to respond with? Like based on information in an external db matching or not matching the email of the current user, to redirect_to to either Wix page A or Wix page B based on that db but to do so server-side not client-side?

Hi Adam,

If I understand correctly, the flow is:
User clicks a button → frontend calls a backend function → backend sends request to external service → response is back → decision is made.

This is possible given the external service has a REST API.
You can create a function in the backend section and use ’ wix-fetch ’ module to make the request.
See here about using the backend functions from the frontend code (there’s also an example of how to send an email using ‘wix-fetch’).

Good Luck,

Liran.