@arkstack/realtime 0.17.12 → 0.17.13

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.
@@ -34,7 +34,18 @@ interface RealtimeTransport {
34
34
  interface PusherClientConfig {
35
35
  key: string;
36
36
  cluster?: string;
37
- /** Endpoint that authorizes private/presence channels. */
37
+ /**
38
+ * Your API's base URL, if provisioned, private/presence channels
39
+ * will be automatically authorized.
40
+ *
41
+ * Will be ignored if {@link authEndpoint} is provisioned.
42
+ */
43
+ apiBase?: string;
44
+ /**
45
+ * Endpoint that authorizes private/presence channels.
46
+ *
47
+ * If provisioned, {@link apiBase} will be ignored.
48
+ */
38
49
  authEndpoint?: string;
39
50
  auth?: {
40
51
  headers?: Record<string, string>;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
- import { a as PusherClientConfig, c as RealtimeSubscription, i as NotificationHandler, l as RealtimeTransport, n as createRealtime, o as RealtimeConfig, r as FirebaseClientConfig, s as RealtimeNotification, t as RealtimeClient, u as RealtimeTransportName } from "./RealtimeClient-D6-kesaz.js";
1
+ import { a as PusherClientConfig, c as RealtimeSubscription, i as NotificationHandler, l as RealtimeTransport, n as createRealtime, o as RealtimeConfig, r as FirebaseClientConfig, s as RealtimeNotification, t as RealtimeClient, u as RealtimeTransportName } from "./RealtimeClient-BlV9xSHd.js";
2
2
 
3
3
  //#region src/transports/pusher.d.ts
4
4
  /**
5
5
  * Realtime transport backed by [pusher-js](https://github.com/pusher/pusher-js).
6
6
  * The SDK is an optional peer dependency imported lazily, so consumers only pull
7
7
  * it in when they use the Pusher transport.
8
+ *
9
+ * @param config
10
+ * @returns
8
11
  */
9
12
  declare const createPusherTransport: (config: PusherClientConfig) => Promise<RealtimeTransport>;
10
13
  //#endregion
package/dist/index.js CHANGED
@@ -79,7 +79,10 @@ var pusher_exports = /* @__PURE__ */ __exportAll({ createPusherTransport: () =>
79
79
  /**
80
80
  * Realtime transport backed by [pusher-js](https://github.com/pusher/pusher-js).
81
81
  * The SDK is an optional peer dependency imported lazily, so consumers only pull
82
- * it in when they use the Pusher transport.
82
+ * it in when they use the Pusher transport.
83
+ *
84
+ * @param config
85
+ * @returns
83
86
  */
84
87
  const createPusherTransport = async (config) => {
85
88
  const mod = await import("pusher-js").catch(() => {
@@ -88,7 +91,7 @@ const createPusherTransport = async (config) => {
88
91
  const client = new (mod.default ?? mod)(config.key, {
89
92
  cluster: config.cluster ?? "mt1",
90
93
  forceTLS: config.forceTLS ?? true,
91
- authEndpoint: config.authEndpoint,
94
+ authEndpoint: config.authEndpoint ?? `${config.apiBase}/realtime/auth`,
92
95
  auth: config.auth
93
96
  });
94
97
  return {
@@ -1,4 +1,4 @@
1
- import { s as RealtimeNotification, t as RealtimeClient } from "../RealtimeClient-D6-kesaz.js";
1
+ import { s as RealtimeNotification, t as RealtimeClient } from "../RealtimeClient-BlV9xSHd.js";
2
2
 
3
3
  //#region src/react/index.d.ts
4
4
  interface UseNotificationsOptions {
@@ -1,4 +1,4 @@
1
- import { s as RealtimeNotification, t as RealtimeClient } from "../RealtimeClient-D6-kesaz.js";
1
+ import { s as RealtimeNotification, t as RealtimeClient } from "../RealtimeClient-BlV9xSHd.js";
2
2
  import { ComputedRef, Ref } from "vue";
3
3
 
4
4
  //#region src/vue/index.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/realtime",
3
- "version": "0.17.12",
3
+ "version": "0.17.13",
4
4
  "type": "module",
5
5
  "description": "Client for consuming Arkstack realtime notifications (Pusher/Firebase), with framework-agnostic core plus React and Vue bindings.",
6
6
  "homepage": "https://arkstack.toneflix.net/guide/notifications",