spotify_client/oauth

Types

pub type RefreshTokenResponse {
  RefreshTokenResponse(
    access_token: String,
    refresh_token: option.Option(String),
    expires_at: timestamp.Timestamp,
  )
}

Constructors

  • RefreshTokenResponse(
      access_token: String,
      refresh_token: option.Option(String),
      expires_at: timestamp.Timestamp,
    )
pub type TokenResponse {
  TokenResponse(
    access_token: String,
    refresh_token: String,
    expires_at: timestamp.Timestamp,
  )
}

Constructors

  • TokenResponse(
      access_token: String,
      refresh_token: String,
      expires_at: timestamp.Timestamp,
    )

Functions

pub fn authenticate_from_token_response(
  response: TokenResponse,
  config: ClientConfig,
) -> SpotifyClient
pub fn exchange_code(
  client: ClientConfig,
  code: String,
) -> Result(TokenResponse, SpotifyError)
pub fn refresh_access_token(
  client: SpotifyClient,
) -> Result(SpotifyClient, SpotifyError)
Search Document