A JavaScript browser library for connecting to a Sketchfab account with OAuth2
npm install @sketchfab/oauth2SketchfabOAuth2 is a JS browser library for connecting to a Sketchfab account with OAuth2.
This library only support the Implicit flow.
To use OAuth2, you need to register your app on Sketchfab.
Insert the script in your HTML page
``html`
Here's how to use the library:
`js
var config = {
hostname: 'sketchfab.com',
client_id: 'INSERT_YOUR_CLIENT_ID_HERE',
redirect_uri: 'http://example.com/authSuccess.html'
};
var client = new SketchfabOAuth2( config );
client.connect().then( function onSuccess( grant ) {
console.log( grant );
} ).catch( function onError( error ) {
console.error( error );
} );
`
* npm installsrc
* Source is in npm run build` to build the browser library
* Run