Skip to content

Commit

Permalink
Updated README.md (#145)
Browse files Browse the repository at this point in the history
* add logs for api

* fix device_id, added preview script

* added more logs

* removed logs
  • Loading branch information
Oleksandr1414 authored Feb 28, 2025
1 parent e9c1f19 commit 43b3cf7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ The whole SAMA stack can be tested using https://app.samacloud.io public cloud.
- In `packages/app`: copy `.env.example` to `.env`.
- Generate VAPID keys via `npx web-push generate-vapid-keys` and set Public Key to `VITE_PUBLIC_VAPID_KEY` in `.env` file
- `npm install` to install dependencies
- `npm run start -workspace=sama` to run server
- `npm run build --workspace=sama-sdk` to install SAMA api
- `npm run start --workspace=sama` to run server
- Access http://localhost:3000 in your browser

There are also other components. Make sure to check [Deploying SAMA chat server stack: a comprehensive guide](https://medium.com/sama-communications/deploying-sama-chat-server-stack-a-comprehensive-guide-294ddb9a2d78)
Expand Down
4 changes: 2 additions & 2 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"type": "module",
"scripts": {
"start": "vite",
"build": "vite build"
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@reduxjs/toolkit": "^1.8.6",
Expand All @@ -26,7 +27,6 @@
"blurhash": "^2.0.5",
"browser-image-compression": "^2.0.2",
"framer-motion": "^8.0.2",
"get-browser-fingerprint": "^3.2.0",
"heic2any": "^0.0.4",
"jsonwebtoken": "^8.5.1",
"jwt-decode": "^3.1.2",
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/sdk/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SAMAClient {
private httpEndpoint: string;
private curerntUserId: string | null = null;
private responsesPromises: Record<string, IResponsePromise> = {};
private deviceId: string;
private deviceId: string | null = null;

public onMessageListener: ((message: IMessage) => void) | null = null;
public onMessageStatusListener: ((status: any) => void) | null = null;
Expand All @@ -25,7 +25,7 @@ class SAMAClient {
constructor({ endpoint: { ws, http } }: { endpoint: { ws: string; http: string } }) {
this.wsEndpoint = ws;
this.httpEndpoint = http;
this.deviceId = getBrowserFingerprint({ hardwareOnly: true }).toString();
getBrowserFingerprint({ hardwareOnly: true }).then((device_id) => (this.deviceId = device_id.toString()));
}

async connect(): Promise<void> {
Expand Down

0 comments on commit 43b3cf7

Please sign in to comment.