Skip to content

Instantly share code, notes, and snippets.

@pzurek
Last active November 26, 2015 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pzurek/26710a41b516c98db39a to your computer and use it in GitHub Desktop.
Save pzurek/26710a41b516c98db39a to your computer and use it in GitHub Desktop.

Introduction

This module should include three main elements that will allow for a full integration of Tidio Chat with a website based on typo3.

These elements are:

  1. Sending a request and saving a pair of the keys to the database
  2. Adding a new position in the admin menu
  3. Adding a script to the page content

Send request and save a pair of database keys

As soon as it is possible, the module should make a request to the server and download a pair of keys. The Address parameters for the request will be variables such as:

website address (domain) administrator email address (optional) REMOTE_ADDR IP address of the user browsing the site (address of the administrator)

After requesting the keys, they should be saved in the configuration for later use.

##Keys request method

Preferred method of requesting the keys is using the cURL library

Data transfer format

After executing the request a JSON object will be received, containing basic information about the created project while making the request. The most important values that have to be kept in the configuration are:

values->private_key
values->public_key

Recording the keys for the configuration

Recording should be made with the basic Typo3 API methods, whlie the keys should contain a prefix with the plugin name (eg. “tidiochat_public_key”)

In case of server failure while requesting the keys

In case of server failure while requesting the keys and lacking them in the configuration a new request should be made everytime website with administrator panel is loaded

Adding a new position to the menu

After the module is installed and the pair of keys collected, administrator menu should include a new position. This position should contain a link to the external website and a private key as a paremeter. The key has been collected before. After clicking the link Tidio Chat panel should be opened in a new window.

Adding the script to the page content

On each of the subsites (seen for visitors that are not logged in) there should be a tag “script” added containing “src” atribute to the external resource. Address should contain public key saved in the configuration earlier.This script will be added to subsites only when a key has been collected before.

##Addresses

Link to download the pair of keys: https://www.tidiochat.com/access/create?url=WEBSITE_ADDRESS&platform=typo3&email=ADMIN_EMAIL_ADDRESS&_ip=ADMIN_IP_ADDRESS

Script file address: https://www.tidiochat.com/uploads/redirect/TIDIOCHAT_PUBLIC_KEY.js

Admin panel address (loggin with a private key): https://external.tidiochat.com/access?privateKey=TIDIOCHAT_PRIVATE_KEY

##Licence Script will be released on GPLv2 licence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment