Home / DialogFlow / Webhooks / NodeJS / Reader Question: Why are you using RunKit for your code samples instead of inline editor?
DialogFlow | NodeJS | Webhooks

Reader Question: Why are you using RunKit for your code samples instead of inline editor?

I got this question from a reader recently:

In your course “Dialogflow for Non-programmers” you are using Runkit to develop your webhook code.
What are the benefits of using Runkit over the Dialogflow’s inline editor?

The reason I use RunKit for my code samples in that course is

a) it is possible for someone to clone my notebook and have working sample code. Here is what they say on the RunKit home page:

b) the same cannot be said of code I write using Dialogflow’s inline editor. In fact, it is almost the exact opposite.

I vaguely mentioned it in a recent article (the 4th challenge), and the main issue is this:

Because of the speed at which the Dialogflow fulfillment libraries and Firebase cloud functions are changing, it is very hard to write tutorials for the inline editor (which generally uses both) which are going to work as written over any extended period of time (say a few months).

I don’t know about you, but I don’t want to be updating my tutorials that often. Although, if you wish to help me do it by finding bugs in my existing articles and writing up the full solution without any input from me and just posting the solution as a comment, I am very happy to return the favor by giving you free access to one of my paid courses 🙂

Also, in RunKit, I use ExpressJS as the framework which handles the JSON requests (as opposed to Firebase cloud functions, which you need to use in the inline editor). Express is a lot more stable when it comes to writing code meant for teaching purposes.

Finally, a word on what it is like for someone to use Firebase cloud functions in the inline editor to write their webhook code while they are in the process of learning Dialogflow: it is exactly like the joke about trying to change a flat tire while you are driving at top speed.

In fact, I don’t recommend learning Dialogflow webhooks that way.

Instead, this is how I recommend you learn webhooks:

  • first understand the basics
  • use a stable tech stack for writing your first set of webhooks – the more boring the better
  • consider using a “database as a REST service” initially before moving on to using a full fledged database, although this step is optional, especially if you are quite experienced with setting up your database access code
  • learn Firebase cloud functions independent of learning Dialogflow – that is, use it to write some other code first, preferably something pretty simple
  • and finally combine all your learning together if you wish to use Dialogflow and NodeJS together, and especially if you want to deploy your webhook to Firebase cloud functions

Related Posts