MY GOAL
I am developing an app for Freshservice using FDK v3, with the goal of creating a graphical interface that, upon clicking a button, triggers a function that retrieves data via HTTP API calls from Freshservice and processes the data.
MY APP STRUCTURE (used template: common-starter-template)
├── app
│ ├── index.html
│ ├── scripts
│ │ ├── app.js
│ │ ├── services/softwareFilterService.js
│ │ └── views/softwareFilterView.js
│ └── functions/softwareFilterFunction.js
├── config/iparams.json
└── manifest.json
scripts/contains the front-end logic (view + service).functions/contains the serverless function that is supposed to make secure calls to Freshservice.manifest.jsonis configured according to FDK v3 without a “functions” section.
MY ISSUE
I wrote the serverless function using module.exports = async function(args, context) and client.request.invoke("platform.get/post") as indicated in the FDK v3 documentation.
On the front-end, I use:
const res = await client.request.invoke("softwareFilterFunction", { serial, ticket });
When I try to run the app (even with fdk run), the CLI gets stuck on this line and returns:
✖ Error: Invalid feature or feature not enabled.
OBJECTIVE
To make my app work securely, meaning without exposing the API Key on the front-end, while still being able to make calls to Freshservice.
Currently, without an external server and without serverless functions enabled, I don’t see a way to implement a secure backend.
Can anyone help me? Thanks in advance