Hey guys,
I built an NPM package to make the process of authenticating apps with Speckle easier. It handles the OAuth process and I tried it hard to make it as simple as possible. I’d appreciate if you could give it a spin and write me any feedback you have.
Here’s a link:
import { SpeckleAuthClient, type ApplicationOptions } from 'speckle-auth';
const options: ApplicationOptions = {
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
serverUrl: 'https://app.speckle.systems',
};
const speckle = new SpeckleAuthClient(options);
async function authenticateUser() {
const user = await speckle.user();
if (!user) {
await speckle.login();
}
return user;
}
async function logoutUser() {
await speckle.logout();
}