Freshchat API

Hi Team,
I want to create custom app in Freshdesk in which I have a use of Freshchat API.
I found one SDK for Freshchat API :

To explore this SDK, I have simple created node project and installed the given command.

Now, When I tried to test installation by using example given in the site,

import Freshchat from '@freshworks-jaya/freshchat-api';

const freshchat = new Freshchat('', '<freshchat-api-token>');

It gives error that “Freshchat is not a constructor”.

What could be the reason for the error?
How can I resolve it?


What Node.js version are you using? Can you try the require() based import mentioned in their docs?

const Freshchat = require('@freshworks-jaya/freshchat-api').default;

var freshchat = new Freshchat('', '<freshchat-api-token>');

This require based approached worked!