crooked-dawn-90821
09/25/2025, 2:08 PMtall-airline-16756
09/25/2025, 2:08 PMtall-airline-16756
09/25/2025, 2:09 PMonTokenRefresh callback to respond whenever a token gets updated:
signalClient.onTokenRefresh = (newToken) => {
console.log('Token refreshed:', newToken);
// Optionally store or use the new token
};
• Manual Token Validation: If you’d prefer to be proactive, you can decode the JWT to check when it expires and then request a new token from your backend if needed. Here’s a simple example:
const { connectionDetails, existingOrRefreshConnectionDetails } = useConnectionDetails(config);
// Before performing an action requiring a valid session:
await existingOrRefreshConnectionDetails();
const token = connectionDetails?.participantToken;
If you’d like, I’m here to help with more details or examples—just let me know!
Sources: livekit/src/rtc_engine/mod.rs | Sources/LiveKit/Protos/livekit_rtc.pb.swift | Voice Assistants | livekit/livekit_composite | DeepWiki | Example Applications | livekit/livekit_composite | DeepWiki | Authentication | LiveKit Docs