Can I test serverless app in local dev env with real data from FreshDesk?

I am developing a app that will get contact create events from Freshdesk. I have found that the simulated product events available thru http://localhost:10001/web/test seems out of date. I would like to get a POST sample for contact update, contact create, account update account create directly from freshdesk.

When I add --tunnel to fdk run, following makes me think that I should be able to send events from Helpdesk to my local app (dev environment - not published).

Starting local testing server at http://*:10001/    
Append 'dev=true' to your Freshdesk account URL to start testing    
e.g. https://domain.freshdesk.com/a/tickets/1?dev=true 

Is this possible?

I tried to connect as noted above and when I updated the contact no event was triggered in my local dev env .

Hi @stevemc,

It’s not possible to directly trigger the locally running app events from the Freshdesk production environment. The tunneling feature is available in FDK only for External Events to test webhook events from third-party platforms.

These are the possible way to achieve your goal to test the local app with real data.

  1. Publish as a temporary custom app and test the app in the Freshdesk account.
  2. Get the payload from a published custom app like the way #1 and grab the payload from Serverless logs and paste it in the simulation page at http://localhost:10001/web/test. This payload is stored under server/test_data to use in the simulation page. Those files can also be directly changed with the required payload for the simulation.

There’s no other way possible to trigger the locally running app from the Freshdesk portal running on cloud environment.

1 Like

Thanks for clarifying. These solutions should suffice. Thanks!

btw: What is the following option for?

–tunnel-auth Authorization token to be used for ngrok.

i ended up getting ngrok subscription and realized with that I only need to run ngrok to have my local app receive events. I’m curious what the above does.

@stevemc An ngrok account is not required to set up a ngrok tunnel for the external events. However, you can add authentication for the tunnel created if you already have an account with ngrok and would like a more secure tunnel feature.

It enables authentication to the tunnel connection that’s created for your local server to the internet. More information can be found in the ngrok documentation about this option.

1 Like

Thanks for the explanation. That clarifies it.

With an ngrok account, I think it’s better to use the ngrok command line tool to set up a proxy between local host: 10001 and the ngrok service. Like this:

[External event svc] -> [http://yourdomain.ngrok.io] -> [ngrok proxy app] -> [fdk local app]

AFAICT, if I use the --tunnel-auth option or just --tunnell, I need to change the webhook URL in my External event svc every single time I run the local app which is really cumbersome.

2 Likes

@stevemc I understand your concern.

I will take it up as feedback to improve upon it. I really appreciate you sharing your experience. Thank you!