Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created May 17, 2024 12:38
Show Gist options
  • Save tim-smart/12d871130ae15c154e44cd190c5c10c8 to your computer and use it in GitHub Desktop.
Save tim-smart/12d871130ae15c154e44cd190c5c10c8 to your computer and use it in GitHub Desktop.
import * as Http from "@effect/platform/HttpClient"
Http.request.post("https://accounts.spotify.com/api/token").pipe(
Http.request.basicAuth(clientId, clientSecret)
Http.request.urlParamsBody({
grant_type: "refresh_token",
refresh_token: refreshToken,
client_id: clientId,
}),
Http.client.fetchOk,
Http.response.json
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment