Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created May 17, 2024 12:38
Show Gist options
  • Select an option

  • Save tim-smart/12d871130ae15c154e44cd190c5c10c8 to your computer and use it in GitHub Desktop.

Select an option

Save tim-smart/12d871130ae15c154e44cd190c5c10c8 to your computer and use it in GitHub Desktop.

Revisions

  1. tim-smart created this gist May 17, 2024.
    12 changes: 12 additions & 0 deletions spotify-refresh.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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
    )