Skip to content

freshworks-developers/instance-method-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RelayDesk Instance Hub

Multi-instance communication demo for Freshdesk and Freshservice on Platform 3.0. RelayDesk shows how one app runs in multiple ticket placeholders on the same page and exchanges data via client.instance APIs.


Surfaces

Surface Placeholder What it demonstrates
Instance Hub ticket_sidebar instance.get(), targeted send with receiver, resize, showModal + modalData launcher
Requester Info ticket_requester_info Cross-location receive, reply to sidebar via get + send
Modal Opened from sidebar Reads modalData from instance.context(), returns data via send

Both support_ticket (Freshdesk) and service_ticket (Freshservice) register the same views.


Features

Live instance list (instance.get)

The sidebar and requester-info panels poll client.instance.get() to list every active app instance in this browser tab — instance id, location, and which row is “self”.

Targeted messaging (send + receiver)

  • Sidebar: pick a receiver from the dropdown or use Ping requester info to target ticket_requester_info directly.
  • Requester info: Send to sidebar resolves ticket_sidebar via get() and sends with an explicit receiver array.

Modal data payload (showModalmodalData)

The sidebar opens a modal with a data object (name, email). The modal reads (await client.instance.context()).modalData and pre-fills the form. Submit sends the payload back to the parent via instance.send() (no receiver — routes to parent).

Resize

Each surface calls client.instance.resize() — sidebar up to 700px, requester info 420px, modal 480px.


Setup

git clone https://github.com/freshworks-developers/instance-method-samples.git
cd instance-method-samples
fdk run

Append ?dev=true to your Freshdesk or Freshservice URL.

Where to test

  1. Open any ticket details page.
  2. Expand ticket sidebar apps — open RelayDesk Instance Hub.
  3. In the requester info strip (contact section), open RelayDesk Requester Info.
  4. Watch both surfaces list each other under Active instances.
  5. Send messages between them or open the modal from the sidebar.

instance.get() only sees instances active in the same browser tab. Both placeholders must be open on the same ticket page.

fdk validate
fdk pack

Project structure

.
├── manifest.json
├── app/
│   ├── views/
│   │   ├── ticket-sidebar.html
│   │   ├── ticket-requester-info.html
│   │   └── modal.html
│   ├── scripts/
│   │   ├── lib/instance-hub.js
│   │   ├── ticket-sidebar.js
│   │   ├── ticket-requester-info.js
│   │   └── modal.js
│   └── styles/
│       ├── common.css
│       ├── ticket-sidebar.css
│       ├── ticket-requester-info.css
│       ├── modal.css
│       └── images/icon.svg
├── README.md
└── USECASE.md

Tech stack

  • Platform: Freshworks Platform 3.0
  • Runtime: Node.js 24.11.0 · FDK 10.1.2
  • UI: Crayons v4

Resources

About

No description or website provided.

Topics

Resources

Contributing

Stars

Watchers

Forks

Contributors