Howto

Home

Integration

In order to establish a connection with the PTK use window.postMessage mechanism - see on this link

window.postMessage({
        channel: 'ptk_messages_channel',
        command: 'SEE SUPPORTED COMMANDS'
    }, '*')

Supported commands:

  • init_recording
  • start_recording
  • stop_recording
  • export_recording
  • reset_recording

To listen to the PTK responses use CustomEvent

Event detail value has the following structure:

detail{
        event: SEE SUPPORTED COMMANDS,
        success: true | false,
        result | error: data
    }

document.addEventListener("ptk_extension_event", function (data) {
        if (data.detail?.success) {
            document.getElementById('export').value = data.detail.event + '\r\n-------------\r\n' + data.detail.result
        } else {
            document.getElementById('export').value = data.detail.event + '\r\n-------------\r\n' + data.detail.error
        }

    })

Type URL: