Skip to content

feat(providers): added SoundCloud provider #3278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/providers/soundcloud.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default function SoundCloud(options) {
return {
id: "soundcloud",
name: "SoundCloud",
type: "oauth",
version: "2.0",
params: { grant_type: "authorization_code" },
accessTokenUrl: "https://api.soundcloud.com/oauth2/token",
authorizationUrl: "https://api.soundcloud.com/connect?response_type=code",
profileUrl: "https://api.soundcloud.com/me",
profile(profile) {
return {
id: profile.id,
name: profile.full_name,
username: profile.username,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SoundCloud doesn't provide email, so I added username. Please review this.

image: profile.avatar_url,
}
},
...options,
}
}
1 change: 1 addition & 0 deletions types/providers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export type OAuthProviderType =
| "Reddit"
| "Salesforce"
| "Slack"
| "SoundCloud"
| "Spotify"
| "Strava"
| "Twitch"
Expand Down
6 changes: 6 additions & 0 deletions types/tests/providers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ Providers.LinkedIn({
scope: "r_emailaddress r_liteprofile",
})

// $ExpectType OAuthConfig<Profile>
Providers.SoundCloud({
clientId: "foo123",
clientSecret: "bar123",
})

// $ExpectType OAuthConfig<Profile>
Providers.Spotify({
clientId: "foo123",
Expand Down
34 changes: 34 additions & 0 deletions www/docs/providers/soundcloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
id: soundcloud
title: SoundCloud
---

## Documentation

https://developers.soundcloud.com/docs/api/guide

## Configuration

https://soundcloud.com/you/apps

## Options

The **SoundCloud Provider** comes with a set of default options:

- [SoundCloud Provider options](https://github.com/nextauthjs/next-auth/blob/main/src/providers/soundcloud.js)

You can override any of the options to suit your own use case.

## Example

```js
import SoundCloudProvider from 'next-auth/providers/soundcloud';
...
providers: [
SoundCloudProvider({
clientId: process.env.SOUNDCLOUD_CLIENT_ID,
clientSecret: process.env.SOUNDCLOUD_CLIENT_SECRET
})
]
...
```
1 change: 1 addition & 0 deletions www/src/components/ProviderMarquee.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const icons = [
'/img/providers/okta-3.svg',
'/img/providers/openid.svg',
'/img/providers/slack.svg',
'/img/providers/soundcloud.svg',
'/img/providers/spotify.svg',
'/img/providers/twitter.svg'
]
Expand Down
7 changes: 7 additions & 0 deletions www/static/img/providers/soundcloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.