Inferable from Scratch
A step-by-step guide to create a minimal Inferable application
This guide will walk you through creating a minimal NodeJS project to integrate with Inferable. This is an example that steps through the core concepts of Inferable.
While this guide uses NodeJS. The same steps and concepts are applicable for the other SDKs.
Prerequisites
Make sure you have Node.js installed and have set up your Inferable machine key as an environment variable (INFERABLE_API_SECRET
).
You can get your API secret by running:
Install dependencies
Install the necessary packages:
Initialize the Inferable client
Create a new file called index.ts
and add the following code to initialize the Inferable client:
Register a function
Now, let’s add a function that greets users:
Start the service
Finally, let’s start the service:
Run the project
To run this example, save the file as app.js
and execute it using Node.js:
Triggering runs
Now that you have the service running and your functions registered. You can interact with it by triggering a Run via:
Was this page helpful?