Getting Started with Serverless Integrations

Getting Started with Serverless Integrations

Serverless functions (also known as functions as a service) can help you simplify your integrations because you only need to code your logic in a function and the service provider will take care of all the backend hardware, scaling, OS, availability, instances, etc…

Other benefits of serverless technology are that the hardware and software is fully managed, scales automatically almost instantly, and you only pay whenever your function runs so it can be very inexpensive.

Some of the most popular serverless providers are Amazon Lambda, Azure Functions and Google Cloud Functions.

For this demonstration we will use Google Cloud Functions. We will integrate a Shopify Webhook with Netsuite. My code will run in NodeJS Javascript and the rest will be managed by Google. As a developer coming from a Netsuite background I found it extremely easy to get started with Google Cloud Functions.

You can set this up within minutes as explained in this video: https://youtu.be/nOlfG5oGets 
Google Cloud Functions Code:

 

This was a quick demonstration on how to get started. From here you can expand the code and keep developing to make your function more robust.

Some suggestions on first things to do:

  • Secure your function by adding a password.
  • Add more logging and different levels of logging.
  • Branch out the logic depending on the data being received.
  • Add node plugins.
  • Make use of other Google Cloud Services such as Google Datastore or Google Storage.
  • Spencer

    Anyway you can post the .js file you are using?

  • Yuu

    Hi, thank you for your sharing. I’m a fresher js dev of NetSuite, i’m currently on training. I want to ask: Do you know how to export Items Line -> to Excel file, which has image of each item in it? And how to change a field color but not InlineHTML field? Sorry for my bad english.

    • Sorry, I have never tried exporting images in lines. Also, I don’t know how to change the field color, I am not even sure that’s possible.

  • Yeah, just set up the RESTlet to take the record id, get the PDF file from the Filing Cabinet or something and then convert it to base64 and send it to the external server with content type PDF.

  • wesh1992

    Incredibly helpful! Thank you for taking the time to make this video