chrome.loginState Stay organized with collections Save and categorize content based on your preferences.
Important:This API worksonly on ChromeOS.
Description
Use thechrome.loginState API to read and monitor the login state.
Permissions
loginStateAvailability
Types
ProfileType
Enum
"SIGNIN_PROFILE" "USER_PROFILE" "LOCK_PROFILE"
Specifies that the extension is in the signin profile.
Specifies that the extension is in the user profile.
Specifies that the extension is in the lock screen profile.
SessionState
Enum
"UNKNOWN" "IN_OOBE_SCREEN" "IN_LOGIN_SCREEN" "IN_SESSION" "IN_LOCK_SCREEN" "IN_RMA_SCREEN"
Specifies that the session state is unknown.
Specifies that the user is in the out-of-box-experience screen.
Specifies that the user is in the login screen.
Specifies that the user is in the session.
Specifies that the user is in the lock screen.
Specifies that the device is in RMA mode, finalizing repairs.
Methods
getProfileType()
chrome.loginState.getProfileType(): Promise<ProfileType>
Gets the type of the profile the extension is in.
Returns
Promise<ProfileType>
Chrome 96+
getSessionState()
chrome.loginState.getSessionState(): Promise<SessionState>
Gets the current session state.
Returns
Promise<SessionState>
Chrome 96+
Events
onSessionStateChanged
chrome.loginState.onSessionStateChanged.addListener(
callback: function,
)
Dispatched when the session state changes.sessionState is the new session state.
Parameters
- callback
function
The
callbackparameter looks like:(sessionState: SessionState) => void
- sessionState
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-20 UTC.