From 343b3f6553788eb2fa4ef998108aee1303a35f0b Mon Sep 17 00:00:00 2001 From: Mukesh Date: Mon, 10 Jul 2023 09:52:46 +0200 Subject: [PATCH 1/5] Update README.md --- service/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/README.md b/service/README.md index c6d95622..05d37dd4 100644 --- a/service/README.md +++ b/service/README.md @@ -1,4 +1,8 @@ -# SDK +

+ +

+ + This is a client-side SDK to interact with chat-e2ee service. It allows dev to build own chat client on top of chate2ee service. It uses [socket.io](https://socket.io/) for websocket connection. [![npm version](https://img.shields.io/npm/v/@chat-e2ee/service.svg)](https://www.npmjs.com/package/@chat-e2ee/service) From 98a2ca0a1ebed444ad10c1709e6c4d0d72dfa986 Mon Sep 17 00:00:00 2001 From: Mukesh Date: Mon, 10 Jul 2023 10:03:12 +0200 Subject: [PATCH 2/5] Update README.md --- service/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/README.md b/service/README.md index 05d37dd4..d95dc19d 100644 --- a/service/README.md +++ b/service/README.md @@ -1,5 +1,5 @@

- +

From 69102f6069465223b282eb9c63eac2b040329404 Mon Sep 17 00:00:00 2001 From: Mukesh Date: Mon, 10 Jul 2023 10:18:35 +0200 Subject: [PATCH 3/5] Update README.md --- service/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/README.md b/service/README.md index d95dc19d..2b2bb997 100644 --- a/service/README.md +++ b/service/README.md @@ -1,5 +1,5 @@

- +

From 80bccea95e3c183afa715200faad5a64bdf5dd7c Mon Sep 17 00:00:00 2001 From: Mukesh Date: Mon, 10 Jul 2023 13:19:48 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5720f964..c45338a9 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,12 @@ Demo: https://chat-e2ee-2.azurewebsites.net 2. Data is **not** stored on any remote server, encrypted data is just relayed to other users, the data can't be decrypted by any man in the middle. 4. **No history** i.e. once chat is closed the data is not recoverable, however encrypted data can be found on memory trace. [Read More](https://github.com/muke1908/chat-e2ee/wiki/How-and-when-your-data-can-be-compromised%3F) -:boom: **Spin up your own frontend**: - - JS SDK and use chat-e2ee backend as service - `@chate2ee/service` [Read Documentation](https://github.com/muke1908/chat-e2ee/tree/master/service) +## :star: JS SDK +[](https://github.com/muke1908/chat-e2ee/tree/master/service) + +**Spin up your own frontend**: +JS SDK and use chat-e2ee backend as service - `@chate2ee/service` +[ :page_with_curl: Documentation](https://github.com/muke1908/chat-e2ee/tree/master/service) --- From be9a16b9db7d4a4d9631dba5a18227c576cdd780 Mon Sep 17 00:00:00 2001 From: Mukesh Date: Mon, 10 Jul 2023 13:23:17 +0200 Subject: [PATCH 5/5] Update README.md --- service/README.md | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/service/README.md b/service/README.md index 2b2bb997..6ffec930 100644 --- a/service/README.md +++ b/service/README.md @@ -11,8 +11,6 @@ This is a client-side SDK to interact with chat-e2ee service. It allows dev to b npm i @chat-e2ee/service ``` -### Usage: - `@chat-e2ee/service` exports the following modules: - createChatInstance - core chat ops. - utils @@ -20,19 +18,6 @@ npm i @chat-e2ee/service - decryptMessage - to decrypt encrypted messages. - setConfig - configuration - set URLs i.e. API endpoints, debugging etc. -`@chat-e2ee/service` will make request to `/` in local env and to [hosted server](https://chat-e2ee-2.azurewebsites.net) in production env by default. If you want to use a custom server, use `setConfig({ apiURL, socketURL });` - -`config` follows: -``` -{ - apiURL: string | null, - socketURL: string | null, - settings: { - disableLog: boolean, - } -} -``` - ### Example and flow: #### 1. Import and initialize the SDK: ``` @@ -141,6 +126,23 @@ chate2ee.on('delivered', (id) => { ``` +--- + +### Config: +Call setConfig with config object to override default config parameters. + +`config` follows: +``` +{ + apiURL: string | null, + socketURL: string | null, + settings: { + disableLog: boolean, + } +} +``` +Note that `@chat-e2ee/service` will make request to `/` in local env and to [hosted server](https://chat-e2ee-2.azurewebsites.net) in production env by default. If you want to use a custom server, use `setConfig({ apiURL, socketURL });` + --- ### Debugging: Open the browser console and filter your logs by @chat-e2ee/service