@arbidocs/sdk 0.4.69 → 0.4.71

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/README.md CHANGED
@@ -48,6 +48,7 @@ await arbi.logout()
48
48
  |----------|-------------|
49
49
  | `arbi.isLoggedIn` | Whether the user is authenticated |
50
50
  | `arbi.hasWorkspace` | Whether a workspace is selected |
51
+ | `arbi.getDeploymentDomain()` | The domain the user's keys are derived for: the `deploymentDomain` option, else the hostname of `url` (e-signing re-derives keys with it) |
51
52
 
52
53
  ## Operations
53
54
 
@@ -3464,6 +3464,12 @@ declare class Arbi {
3464
3464
  private readonly sessionExpiredListeners;
3465
3465
  private readonly options;
3466
3466
  constructor(options: ArbiOptions);
3467
+ /**
3468
+ * The deployment domain the user's keys are derived for: `deploymentDomain` when given,
3469
+ * otherwise the hostname of `url`. Signing and password changes re-derive keys with it, so a
3470
+ * host that needs it (the document tools' e-signing) reads it here rather than recomputing it.
3471
+ */
3472
+ getDeploymentDomain(): string;
3467
3473
  /** Initialize the SDK client and sodium crypto. Called automatically by login(). */
3468
3474
  init(): Promise<ArbiClient>;
3469
3475
  /**
@@ -3464,6 +3464,12 @@ declare class Arbi {
3464
3464
  private readonly sessionExpiredListeners;
3465
3465
  private readonly options;
3466
3466
  constructor(options: ArbiOptions);
3467
+ /**
3468
+ * The deployment domain the user's keys are derived for: `deploymentDomain` when given,
3469
+ * otherwise the hostname of `url`. Signing and password changes re-derive keys with it, so a
3470
+ * host that needs it (the document tools' e-signing) reads it here rather than recomputing it.
3471
+ */
3472
+ getDeploymentDomain(): string;
3467
3473
  /** Initialize the SDK client and sodium crypto. Called automatically by login(). */
3468
3474
  init(): Promise<ArbiClient>;
3469
3475
  /**
package/dist/browser.cjs CHANGED
@@ -6186,10 +6186,18 @@ var Arbi = class {
6186
6186
  this.options = options;
6187
6187
  }
6188
6188
  // ── Lifecycle ───────────────────────────────────────────────────────────
6189
+ /**
6190
+ * The deployment domain the user's keys are derived for: `deploymentDomain` when given,
6191
+ * otherwise the hostname of `url`. Signing and password changes re-derive keys with it, so a
6192
+ * host that needs it (the document tools' e-signing) reads it here rather than recomputing it.
6193
+ */
6194
+ getDeploymentDomain() {
6195
+ return this.options.deploymentDomain ?? new URL(this.options.url).hostname;
6196
+ }
6189
6197
  /** Initialize the SDK client and sodium crypto. Called automatically by login(). */
6190
6198
  async init() {
6191
6199
  if (this.client) return this.client;
6192
- const domain = this.options.deploymentDomain ?? new URL(this.options.url).hostname;
6200
+ const domain = this.getDeploymentDomain();
6193
6201
  this.client = client.createArbiClient({
6194
6202
  baseUrl: this.options.url,
6195
6203
  deploymentDomain: domain,
@@ -6484,7 +6492,7 @@ var Arbi = class {
6484
6492
  { ...params, email, userExtId: lr2.userExtId },
6485
6493
  {
6486
6494
  fetchClient: client$1.fetch,
6487
- deploymentDomain: this.options.deploymentDomain ?? new URL(this.options.url).hostname
6495
+ deploymentDomain: this.getDeploymentDomain()
6488
6496
  }
6489
6497
  );
6490
6498
  this.loginResult = { ...lr2, signingPrivateKey: result.newSigningPrivateKey };