Manage sessions for frontend integration
There are two ways to provide a session ID when using the Delivery Gateway embedded UI:
- Use your merchant ID
- Pass the session ID from a backend service.
For a lightweight frontend integration, we recommend using the merchant ID: you pass it to the DGW instance and our Web Plugin will initalize the instance:
const instance = DGW.mount({
containerId: "delivery-gateway",
merchantId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
});
Get the merchant ID from either:
- The Admin Dashboard(link goes here).
- The Merchant API(link goes here).
To make sure that only authorized entities can use your merchant ID to initialize Delivery Gateway sessions with the Web Plugin, set up allowed HTTP referrers: HTTP referrers for the embedded UI.