I've been trying to write a plugin which pulls data and assets from the Spotify API into Sketch documents. But interacting with the API requires authentication. I've been able to work around this by hard-coding an access token into the request, and I'm able to do all sorts of fun stuff, like pull in artist photos and album art.
But, if I wanted to share the plugin with other people, it would need to use their own accounts, not mine, and not require mucking around in the code. I've attempted to implement the spec they outline in the API documentation. I successfully open the page to grant access, and when approved, it sends the user back to Sketch. But, there are parameters passed int the URL which I have no idea how to access, which are needed for the next step of authentication.
Does anyone know how to access query parameters from Sketch's custom URL in a plugin? Or is there another way to authenticate which might be easier? Any help would be appreciated!