Skip to content

Commit

Permalink
Update README.md (#315)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
  • Loading branch information
muke1908 authored Jul 10, 2023
1 parent 0f63c35 commit 8ab6b0b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
[<img align="center" width="200" src="https://i.imgur.com/O3Wr6fK.png">](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)

---

Expand Down
38 changes: 22 additions & 16 deletions service/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# SDK
<p align="center">
<img align="center" width="300" src="https://i.imgur.com/O3Wr6fK.png">
</p>


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)
Expand All @@ -7,28 +11,13 @@ 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
- generateUUID - util func to generate UUID.
- 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:
```
Expand Down Expand Up @@ -137,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
Expand Down

0 comments on commit 8ab6b0b

Please sign in to comment.