From 787815b8dfff896a557521b1c5159c8afd903d01 Mon Sep 17 00:00:00 2001 From: Shashwat Srivastava Date: Wed, 13 Feb 2019 16:38:25 +0530 Subject: [PATCH] v2 examples --- inbox-app/index.html | 14 ++++----- live-discussion-app/index.html | 17 ++++++----- side-chat-app/README.md | 42 +++++++++++++++++++++++++ side-chat-app/index.html | 56 ++++++++++++++++++++++++++++++++++ widget-example/index.html | 14 ++++----- 5 files changed, 121 insertions(+), 22 deletions(-) create mode 100644 side-chat-app/README.md create mode 100644 side-chat-app/index.html diff --git a/inbox-app/index.html b/inbox-app/index.html index 29b60a3..4f55891 100644 --- a/inbox-app/index.html +++ b/inbox-app/index.html @@ -5,9 +5,9 @@ ChatCamp JavaScript SDK - Widget Example @@ -20,7 +20,7 @@
- + ChatCamp JavaScript SDK - Live Discussion App @@ -20,7 +20,7 @@
- + ` +- Finally we need to initialize the chat UI kit. Add the following code right after the above script tag: +``` + // Initialize ChatCamp + window.ChatCampUi.init({ + appId: APP_ID, + user: { + id: USER_ID, + displayName: USER_DISPLAY_NAME // optional + // accessToken: USER_ACCESS_TOKEN // optional + }, + ui: { + theme: { + primaryBackground: "#3f45ad", + primaryText: "#ffffff", + secondaryBackground: "#ffffff", + secondaryText: "#000000", + tertiaryBackground: "#f4f7f9", + tertiaryText: "#263238" + }, + roster: { + tabs: ['recent', 'rooms', 'users'], + render: true, + defaultMode: 'open' // other possible values are minimize, hidden + } + } + }) +``` +Here `APP_ID`, `USER_ID`, `USER_DISPLAY_NAME`, and `USER_ACCESS_TOKEN` should be replaced by correct string values and you are good to go. :) + +The Chat UI kit uses our ChatCamp JavaScript SDK to connect to our ChatCamp backend. diff --git a/side-chat-app/index.html b/side-chat-app/index.html new file mode 100644 index 0000000..e5099f7 --- /dev/null +++ b/side-chat-app/index.html @@ -0,0 +1,56 @@ + + + + + + + + ChatCamp JavaScript SDK - Side Chat App + + + + + +
+ + + + + diff --git a/widget-example/index.html b/widget-example/index.html index eda24d8..26a6aac 100644 --- a/widget-example/index.html +++ b/widget-example/index.html @@ -5,9 +5,9 @@ ChatCamp JavaScript SDK - Widget Example @@ -20,7 +20,7 @@
- +