Repository navigation
v8.12.0
Minor Changes
-
add support for Durable function callbacks (#1377) (53730c8)
-
context: issues only have the conflict and update_required kinds (#1382) (6e5f35d)
-
add a reactive
authconfig option for credentials that change during the client's lifetime (#1355) (d7f43fe)createClient({auth})accepts an observable of promises of the current credential ({token},{withCredentials: true}orundefined), for apps where the access token is refreshed or the user signs in and out while the client is alive. While a renewal is in progress, emit the promise the refresh returns. Requests and reconnects wait for it, so an expired token is never sent, and openlisten()/live.events()streams reconnect once the new credential settles. See the "Reactive authentication" section of the README for the contract.Also adds
client.getAuth(), which resolves to the credential the client would send right now, andclient.observeAuth(), which emits it and every change. Both work the same whether the client is configured withauthor with static options. Statictoken/withCredentialsconfiguration is unchanged.Under a reactive
auth,client.config().tokenandclient.config().withCredentialsareundefined, sinceconfig()describes what was configured; useclient.getAuth()to read the credential the client sends.