auth_helpers library

Functions

createLongLivedToken(String serverUrl, String accessToken, {String tokenName = _defaultTokenName}) Future<String>
Create a long-lived token using an existing session token.
discoverServers({Duration timeout = const Duration(seconds: 5)}) Future<List<String>>
Discover Music Assistant servers on the local network using mDNS.
getServerInfo(String serverUrl) Future<ServerInfoMessage>
Get server information from the /info endpoint (no authentication required).
login(String serverUrl, String username, String password) Future<(User, String)>
Log in to a Music Assistant server with username and password.
loginWithToken(String serverUrl, String username, String password, {String tokenName = _defaultTokenName}) Future<(User, String)>
Log in and immediately exchange the session token for a long-lived token.