Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated README.md #145

Merged
merged 4 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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