Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Last active December 25, 2016 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeaholicguy/3608c54db1a1d8b028686810afc14ba1 to your computer and use it in GitHub Desktop.
Save codeaholicguy/3608c54db1a1d8b028686810afc14ba1 to your computer and use it in GitHub Desktop.
import SoundCloud from 'soundcloud';
const API_HOST = '//api.soundcloud.com';
export function auth() {
SoundCloud.connect().then((session) => {
fetchMe(session)
});
}
function fetchMe(session) {
fetch(`${API_HOST}/me?oauth_token=${session.oauth_token}`)
.then((res) => res.json())
.then((data) => {
console.log('me', data);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment