@touchcastllc/napster-companion-api-dev 1.0.0-alpha.83 → 1.0.0-alpha.85

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.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Acquire the microphone, normalising any failure into a ConnectionError whose
3
+ * `context.name` carries the underlying DOMException ("NotAllowedError" vs
4
+ * "NotFoundError") so apps can tell a refusal from a missing device.
5
+ *
6
+ * The manager caches the stream, so every later caller reuses it and the user
7
+ * sees exactly one browser prompt per session.
8
+ */
9
+ export declare function requestMicrophone(): Promise<void>;
@@ -530,6 +530,26 @@ export interface NapsterCompanionApiSDK {
530
530
  * when run inside the persistence site frame.
531
531
  */
532
532
  initWithButton(getToken: () => Promise<string>, config?: Partial<NapsterCompanionApiConfig>): import("../button").NapsterCompanionApiController;
533
+ /**
534
+ * Prompt for the microphone WITHOUT starting a session, so permission is settled
535
+ * before a connection token exists. A connection's lifetime starts the moment the
536
+ * backend creates it, and a prompt the user leaves open for seconds spends that
537
+ * budget before signaling runs — the session then fails to come up.
538
+ *
539
+ * `initWithButton` does this internally. Use it on the `init` path, where the host
540
+ * app owns when the token is minted:
541
+ *
542
+ * ```js
543
+ * await SDK.requestMicrophoneAccess();
544
+ * const token = await mintConnectionToken();
545
+ * await SDK.init(token, config);
546
+ * ```
547
+ *
548
+ * Rejects with a `ConnectionError` whose `context.name` is the underlying
549
+ * DOMException — `"NotAllowedError"` (refused) or `"NotFoundError"` (no device).
550
+ * Calling it is free once granted: the stream is cached and reused by the session.
551
+ */
552
+ requestMicrophoneAccess(): Promise<void>;
533
553
  /** The SDK version string (useful for diagnostics). */
534
554
  version: string;
535
555
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@touchcastllc/napster-companion-api-dev",
3
- "version": "1.0.0-alpha.83",
3
+ "version": "1.0.0-alpha.85",
4
4
  "keywords": [
5
5
  "napster",
6
6
  "companion-api",