Improved errors
New Features
- You can now include
signUpOptionsas an option when creating a Bitski connect button:
import { LOGIN_HINT_SIGNUP, ConnectButtonSize, Bitski } from 'bitski';
// Default to sign up flow when logging in
const opts = {
size: ConnectButtonSize.Large,
signInOptions: {
login_hint: LOGIN_HINT_SIGNUP,
},
};
const button = bitski.getConnectButton(opts);- There are now custom error types for most errors thrown by the Bitski SDK. See the src/errors folder within each sub-package for more details.
// Handling user cancelled error
import { AuthenticationErrorCode } from 'bitski';
try {
await bitski.signIn();
} catch (error) {
if (error.code === AuthenticationErrorCode.UserCancelled) {
// handle cancellation
} else {
// handle error
}
}