Skip to content

Commit e741279

Browse files
committed
update documentation removing SpotifyApiOptionsBuilder
1 parent ea2e3c1 commit e741279

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ Example creation, using an existing Token and setting automatic token refresh to
144144
```kotlin
145145
val token = spotifyAppApi(spotifyClientId, spotifyClientSecret).build().token
146146
val api = spotifyAppApi(
147-
"clientId",
148-
"clientSecret",
149-
token,
150-
SpotifyApiOptionsBuilder(
151-
automaticRefresh = false
152-
)
153-
)
147+
"clientId",
148+
"clientSecret",
149+
token
150+
) {
151+
automaticRefresh = false
152+
}.build()
153+
154154
println(api.browse.getNewReleases()) // use it
155155
```
156156

@@ -228,11 +228,11 @@ val api = spotifyClientPkceApi(
228228
"clientId", // optional. include for token refresh
229229
"your-redirect-uri", // optional. include for token refresh
230230
code,
231-
codeVerifier, // the same code verifier you used to generate the code challenge
232-
SpotifyApiOptionsBuilder(
233-
retryWhenRateLimited = false
234-
)
235-
).build()
231+
codeVerifier // the same code verifier you used to generate the code challenge
232+
) {
233+
retryWhenRateLimited = false
234+
}.build()
235+
236236
println(api.library.getSavedTracks().take(10).filterNotNull().map { it.track.name })
237237
```
238238

@@ -277,13 +277,12 @@ val api = spotifyClientApi(
277277
"clientId",
278278
"clientSecret",
279279
"your-redirect-uri",
280-
token,
281-
SpotifyApiOptionsBuilder(
282-
onTokenRefresh = {
283-
println("Token refreshed at ${System.currentTimeMillis()}")
284-
}
285-
)
286-
).build()
280+
token
281+
) {
282+
onTokenRefresh = {
283+
println("Token refreshed at ${System.currentTimeMillis()}")
284+
}
285+
}.build()
287286
println(api.personalization.getTopTracks(limit = 5).items.map { it.name })
288287
```
289288

0 commit comments

Comments
 (0)