Get Current Module Name in Common App Development

Hi All,

I’m working on common app of FCSS, where my app will be displayed in freshdesk, freshsales, freshchat etc.

so, as per documentation, using currentHost function, I’m getting data of selected modules for which my app will work.

async function getCurrentHostData() {
  try {
    const data = await client.data.get("currentHost");
    // success operation
    // "data" is {subscribed_modules: [“contact”, “deal”, ... }}
  } catch (error) {
    // failure operation
  }
}

getCurrentHostData();

but, I need to get current module name only, where my app is open, like support_ticket or support_contact etc.

Because base on that, I’ll call my custom function or api.

Hi @Yash_Lekinwala,

Welcome to the community :tada:

  const data = await client.instance.context()
  const location = data.location;
  const product = client.context.product;

 //location contains  (conversation_user_info, ticket_sidebar, support_contact)
 //product contains (freshchat, freshdesk)

Hope that helps!

Let me know otherwise.

Thank you.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.