warnings$

View as MarkdownOpen in Claude
1get warnings$(): Observable<SDKWarning>

Observable stream of non-fatal SDK warnings.

Subscribe to detect SDK behaviors that affect session liveness or developer-facing contracts but do not warrant disconnection — for example, a fallback from Client Bound SAT refresh to the developer-provided refresh() because the SAT lacks sat:refresh scope. Each warning is discriminated by its code. See SDKWarning.

Independent from errors$: existing error consumers are not notified, so reacting to a warning does not trigger error-handling code paths (disconnect cascades, user-facing toasts).

Examples

1client.warnings$.subscribe((warning) => {
2 switch (warning.code) {
3 case 'credential_refresh_fallback':
4 console.warn('Fell back to developer refresh:', warning.reason);
5 break;
6 case 'credential_no_refresh_handler':
7 console.warn('Session will end at', new Date(warning.expiresAt));
8 break;
9 }
10});