@every-app/sdk 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@every-app/sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "./src/client/index.ts",
6
6
  "exports": {
@@ -27,10 +27,14 @@ export class SessionManager {
27
27
 
28
28
  constructor(config: SessionManagerConfig) {
29
29
  this.parentOrigin = import.meta.env.VITE_GATEWAY_URL;
30
- this.appId = config.appId || this.detectAppId();
31
30
  this.messageTimeout = 5000;
32
31
  this.debug = config.debug ?? false;
33
32
 
33
+ if (!config.appId) {
34
+ throw new Error("[SessionManager] appId is required.");
35
+ }
36
+ this.appId = config.appId;
37
+
34
38
  if (!this.parentOrigin) {
35
39
  throw new Error(
36
40
  "[SessionManager] Set the Parent Origin by specifying the VITE_GATEWAY_URL env var.",
@@ -48,17 +52,6 @@ export class SessionManager {
48
52
  this.setupMessageListener();
49
53
  }
50
54
 
51
- private detectAppId(): string {
52
- if (typeof window === "undefined") return "";
53
-
54
- const url = new URL(window.location.href);
55
- return (
56
- url.searchParams.get("appId") ||
57
- url.hostname.split(".")[0] ||
58
- "embedded-app"
59
- );
60
- }
61
-
62
55
  private log(message: string, data?: unknown) {
63
56
  if (this.debug) {
64
57
  console.log(`[SessionManager - Logger] ${message}`, data);