This is the unofficial JavaScript SDK for Dribbble, making it easy to communicate with its API in your JavaScript application.
# bun
bun install @hurby/dribbble.js
# pnpm
pnpm install @hurby/dribbble.js
# npm
npm install @hurby/dribbble.js
import { Dribbble, Users } from "@hurby/dribbble.js";
// Setup Dribbble OAuth client
const dribbbleClient = new Dribbble({
clientId: process.env.DRIBBBLE_CLIENT_ID,
clientSecret: process.env.DRIBBBLE_CLIENT_SECRET,
redirectURI: process.env.DRIBBBLE_REDIRECT_URI,
});
// Generate random state
const state = dribbbleClient.generateState();
// Generate the authorization URL
const authURL = dribbbleClient.createAuthorizationURL(state, [
"public",
"upload",
]);
// Redirect the user to the auth URL
// After redirect, use the authorization code to get the access token
const { accessToken, error } = await dribbbleClient.validateAuthorizationCode(
"authorizationCode"
);
For more functions usage, see Docs