Build the authorization URL to redirect users to SoundCloud's OAuth login page.
Optionaloptions: { codeChallenge?: string; state?: string }Optional parameters for the authorization request
OptionalcodeChallenge?: stringPKCE S256 code challenge for enhanced security
Optionalstate?: stringOpaque state value for CSRF protection
The full authorization URL to redirect the user to
Exchange client credentials for an access token (machine-to-machine auth).
The OAuth token response
Exchange an authorization code for user tokens (authorization_code grant).
The authorization code received from the OAuth callback
OptionalcodeVerifier: stringPKCE code verifier if a code challenge was used
The OAuth token response including access and refresh tokens
Refresh an expired access token using a refresh token.
The refresh token from a previous token response
A new OAuth token response with fresh access and refresh tokens
Invalidate the session associated with an access token.
Note: This hits https://secure.soundcloud.com, NOT the regular
api.soundcloud.com host used by all other endpoints.
The access token to invalidate
Authentication namespace — OAuth token grants and session management.
Example