From 14cd96055245b3fe2f747e911b503bcf97e7f1cd Mon Sep 17 00:00:00 2001 From: Adrian Czerwiec Date: Fri, 22 May 2026 15:58:16 +0200 Subject: [PATCH 1/6] adjust the docs --- docs/how-to/backend/server-setup.mdx | 55 ++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/docs/how-to/backend/server-setup.mdx b/docs/how-to/backend/server-setup.mdx index 8d303cba..e98106d0 100644 --- a/docs/how-to/backend/server-setup.mdx +++ b/docs/how-to/backend/server-setup.mdx @@ -61,9 +61,46 @@ Let's setup everything you need to start communicating with a Fishjam instance. First of all, view your app in the [**Fishjam developer panel**](https://fishjam.io/app) and copy your **Fishjam ID** and the **Management Token**. They are required to proceed. Now, we are ready to dive into the code. +The verifying factory constructs the client and pings the Fishjam backend with the supplied credentials, so a bad `fishjamId` or `managementToken` fails at startup instead of on the first room operation. + - + + ```ts + process.env.FISHJAM_ID = "aaa"; + process.env.FISHJAM_MANAGEMENT_TOKEN = "bbb"; + + // ---cut--- + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + + const fishjamClient = await FishjamClient.create({ + fishjamId: process.env.FISHJAM_ID!, + managementToken: process.env.FISHJAM_MANAGEMENT_TOKEN!, + }); + ``` + + + + + + ```python + import os + from fishjam import FishjamClient + + fishjam_client = FishjamClient.create_and_verify( + fishjam_id=os.environ["FISHJAM_ID"], + management_token=os.environ["FISHJAM_MANAGEMENT_TOKEN"], + ) + ``` + + + + +If you need synchronous construction (for example inside a framework plugin that is not async), use the plain constructor and verify separately. The constructor only checks that the fields are non-empty; it does not contact the backend. + + + + ```ts process.env.FISHJAM_ID = "aaa"; process.env.FISHJAM_MANAGEMENT_TOKEN = "bbb"; @@ -71,10 +108,12 @@ They are required to proceed. Now, we are ready to dive into the code. // ---cut--- import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; - const fishjamId = process.env.FISHJAM_ID; - const managementToken = process.env.FISHJAM_MANAGEMENT_TOKEN; + const fishjamClient = new FishjamClient({ + fishjamId: process.env.FISHJAM_ID!, + managementToken: process.env.FISHJAM_MANAGEMENT_TOKEN!, + }); - const fishjamClient = new FishjamClient({ fishjamId, managementToken }); + await fishjamClient.checkCredentials(); ``` @@ -85,10 +124,12 @@ They are required to proceed. Now, we are ready to dive into the code. import os from fishjam import FishjamClient - fishjam_id = os.environ["FISHJAM_ID"] - management_token = os.environ["FISHJAM_MANAGEMENT_TOKEN"] + fishjam_client = FishjamClient( + fishjam_id=os.environ["FISHJAM_ID"], + management_token=os.environ["FISHJAM_MANAGEMENT_TOKEN"], + ) - fishjam_client = FishjamClient(fishjam_id, management_token) + fishjam_client.check_credentials() ``` From 3d36b00934240009758387761bf9728f91a86e2e Mon Sep 17 00:00:00 2001 From: Adrian Czerwiec Date: Thu, 11 Jun 2026 10:28:09 +0200 Subject: [PATCH 2/6] make the docs more concise --- docs/how-to/backend/server-setup.mdx | 47 ++++++---------------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/docs/how-to/backend/server-setup.mdx b/docs/how-to/backend/server-setup.mdx index e98106d0..f2ba141c 100644 --- a/docs/how-to/backend/server-setup.mdx +++ b/docs/how-to/backend/server-setup.mdx @@ -61,7 +61,7 @@ Let's setup everything you need to start communicating with a Fishjam instance. First of all, view your app in the [**Fishjam developer panel**](https://fishjam.io/app) and copy your **Fishjam ID** and the **Management Token**. They are required to proceed. Now, we are ready to dive into the code. -The verifying factory constructs the client and pings the Fishjam backend with the supplied credentials, so a bad `fishjamId` or `managementToken` fails at startup instead of on the first room operation. +`FishjamClient.create` constructs the client and pings the Fishjam backend with the supplied credentials, so a bad `fishjamId` or `managementToken` fails at startup instead of on the first room operation. @@ -77,6 +77,10 @@ The verifying factory constructs the client and pings the Fishjam backend with t fishjamId: process.env.FISHJAM_ID!, managementToken: process.env.FISHJAM_MANAGEMENT_TOKEN!, }); + + // The above is roughly equivalent to: + // const fishjamClient = new FishjamClient({ ... }); + // await fishjamClient.checkCredentials(); ``` @@ -91,6 +95,10 @@ The verifying factory constructs the client and pings the Fishjam backend with t fishjam_id=os.environ["FISHJAM_ID"], management_token=os.environ["FISHJAM_MANAGEMENT_TOKEN"], ) + + # The above is roughly equivalent to: + # fishjam_client = FishjamClient(...) + # fishjam_client.check_credentials() ``` @@ -98,43 +106,6 @@ The verifying factory constructs the client and pings the Fishjam backend with t If you need synchronous construction (for example inside a framework plugin that is not async), use the plain constructor and verify separately. The constructor only checks that the fields are non-empty; it does not contact the backend. - - - - ```ts - process.env.FISHJAM_ID = "aaa"; - process.env.FISHJAM_MANAGEMENT_TOKEN = "bbb"; - - // ---cut--- - import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; - - const fishjamClient = new FishjamClient({ - fishjamId: process.env.FISHJAM_ID!, - managementToken: process.env.FISHJAM_MANAGEMENT_TOKEN!, - }); - - await fishjamClient.checkCredentials(); - ``` - - - - - - ```python - import os - from fishjam import FishjamClient - - fishjam_client = FishjamClient( - fishjam_id=os.environ["FISHJAM_ID"], - management_token=os.environ["FISHJAM_MANAGEMENT_TOKEN"], - ) - - fishjam_client.check_credentials() - ``` - - - - ### Managing rooms Create a room to get the `roomId` and be able to start adding peers. From a118176851f1c950c6a5f472093df65d46ec991d Mon Sep 17 00:00:00 2001 From: Adrian Czerwiec Date: Thu, 11 Jun 2026 11:24:50 +0200 Subject: [PATCH 3/6] bump submodules --- packages/js-server-sdk | 2 +- packages/python-server-sdk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/js-server-sdk b/packages/js-server-sdk index 078f2496..0da64e85 160000 --- a/packages/js-server-sdk +++ b/packages/js-server-sdk @@ -1 +1 @@ -Subproject commit 078f24967485d472cccb3de0de191adb81509a38 +Subproject commit 0da64e85b58bd8e73f1857b2594c2bd14bd35ba9 diff --git a/packages/python-server-sdk b/packages/python-server-sdk index c66f08f3..f87098ee 160000 --- a/packages/python-server-sdk +++ b/packages/python-server-sdk @@ -1 +1 @@ -Subproject commit c66f08f330f95b1648076acd63fe4f178dc52ba4 +Subproject commit f87098ee792a4dbe0eed6725677eb3388ccc2834 From 037444d4a4e4d7bb40542b673a13ba41b391bb8e Mon Sep 17 00:00:00 2001 From: Adrian Czerwiec Date: Thu, 11 Jun 2026 11:34:45 +0200 Subject: [PATCH 4/6] uncomment good code --- docs/how-to/backend/server-setup.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/how-to/backend/server-setup.mdx b/docs/how-to/backend/server-setup.mdx index 2d45e75f..420bfd03 100644 --- a/docs/how-to/backend/server-setup.mdx +++ b/docs/how-to/backend/server-setup.mdx @@ -79,8 +79,8 @@ They are required to proceed. Now, we are ready to dive into the code. }); // The above is roughly equivalent to: - // const fishjamClient = new FishjamClient({ ... }); - // await fishjamClient.checkCredentials(); + const fishjamClient = new FishjamClient({ ... }); + await fishjamClient.checkCredentials(); ``` @@ -97,8 +97,8 @@ They are required to proceed. Now, we are ready to dive into the code. ) # The above is roughly equivalent to: - # fishjam_client = FishjamClient(...) - # fishjam_client.check_credentials() + fishjam_client = FishjamClient(...) + fishjam_client.check_credentials() ``` From c02adec58c5948ee0d9df8ded96a983b23cc30e4 Mon Sep 17 00:00:00 2001 From: Adrian Czerwiec Date: Thu, 11 Jun 2026 11:54:54 +0200 Subject: [PATCH 5/6] use let --- docs/how-to/backend/server-setup.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/how-to/backend/server-setup.mdx b/docs/how-to/backend/server-setup.mdx index 420bfd03..10f3d7a8 100644 --- a/docs/how-to/backend/server-setup.mdx +++ b/docs/how-to/backend/server-setup.mdx @@ -73,13 +73,13 @@ They are required to proceed. Now, we are ready to dive into the code. // ---cut--- import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; - const fishjamClient = await FishjamClient.create({ + let fishjamClient = await FishjamClient.create({ fishjamId: process.env.FISHJAM_ID!, managementToken: process.env.FISHJAM_MANAGEMENT_TOKEN!, }); // The above is roughly equivalent to: - const fishjamClient = new FishjamClient({ ... }); + fishjamClient = new FishjamClient({ ... }); await fishjamClient.checkCredentials(); ``` From 62873fbea05b0d0a68ff6728b85abb0d55acb468 Mon Sep 17 00:00:00 2001 From: Adrian Czerwiec Date: Thu, 11 Jun 2026 11:57:02 +0200 Subject: [PATCH 6/6] remove redundant explanation --- docs/how-to/backend/server-setup.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/how-to/backend/server-setup.mdx b/docs/how-to/backend/server-setup.mdx index 10f3d7a8..b3f37d85 100644 --- a/docs/how-to/backend/server-setup.mdx +++ b/docs/how-to/backend/server-setup.mdx @@ -104,8 +104,6 @@ They are required to proceed. Now, we are ready to dive into the code. -If you need synchronous construction (for example inside a framework plugin that is not async), use the plain constructor and verify separately. The constructor only checks that the fields are non-empty; it does not contact the backend. - ### Managing rooms Create a room to get the `roomId` and be able to start adding peers.