@hipnation-truth/sdk 0.26.6 → 0.26.7

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/dist/index.d.mts CHANGED
@@ -77,8 +77,15 @@ type Environment = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
77
77
  * your identity provider's Clerk JWT template named "convex"
78
78
  * (e.g. `getToken({ template: "convex" })` from `@clerk/expo`), or
79
79
  * `null` when no user is signed in.
80
+ *
81
+ * Convex invokes this with `{ forceRefreshToken: true }` when the cached
82
+ * token has expired — forward it to your provider (e.g. Clerk's
83
+ * `getToken({ template: "convex", skipCache: opts?.forceRefreshToken })`)
84
+ * so the refresh returns a fresh token rather than a stale cached one.
80
85
  */
81
- type AuthTokenFetcher = () => Promise<string | null | undefined>;
86
+ type AuthTokenFetcher = (opts?: {
87
+ forceRefreshToken?: boolean;
88
+ }) => Promise<string | null | undefined>;
82
89
  /**
83
90
  * Configuration for initializing a TruthClient.
84
91
  */
package/dist/index.d.ts CHANGED
@@ -77,8 +77,15 @@ type Environment = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
77
77
  * your identity provider's Clerk JWT template named "convex"
78
78
  * (e.g. `getToken({ template: "convex" })` from `@clerk/expo`), or
79
79
  * `null` when no user is signed in.
80
+ *
81
+ * Convex invokes this with `{ forceRefreshToken: true }` when the cached
82
+ * token has expired — forward it to your provider (e.g. Clerk's
83
+ * `getToken({ template: "convex", skipCache: opts?.forceRefreshToken })`)
84
+ * so the refresh returns a fresh token rather than a stale cached one.
80
85
  */
81
- type AuthTokenFetcher = () => Promise<string | null | undefined>;
86
+ type AuthTokenFetcher = (opts?: {
87
+ forceRefreshToken?: boolean;
88
+ }) => Promise<string | null | undefined>;
82
89
  /**
83
90
  * Configuration for initializing a TruthClient.
84
91
  */