Call Shopify apps Oauth process through external (export) server-less handler

I am using a server-less external function with a single parameter “event” for my Shopify Application

exports.handler = async (event) => {

App (express) and routing is made somewhere else. The handler is called, according to the rout URL or any other event, with the data needed for this event to be executed.

My problem is in the new Shopify API for auth the http request and response (which I don’t have) are required.

> const instalUrl = await Shopify.Auth.beginAuth(request,response,shop,'/callback',true);>
> shopApiSession = await Shopify.Auth.validateAuthCallback(request,response,request.query); >

What is the best practice of performing Shopify App auth process within a server-less node model?

You can attach your serverless function to API Gateway and treat it as an endpoint. That will support both request and response with the package serverless-http and express package.

If you feel like my answer is helpful, please mark it as a solution. Let me know if you have any further questions.
Thank you!
Mritunjay