SnackBaseClient class, the main entry point for the SnackBase JavaScript SDK.
Constructor
Create a new SnackBaseClient instance:Configuration
Properties
Auth State
Services
Methods
Configuration
getConfig()
Get the current client configuration.
Authentication
login(credentials)
Authenticate with email and password.
client.auth.loginWithPassword()
logout()
Log out the current user.
client.auth.logout()
register(data)
Register a new user and account.
client.auth.register()
refreshToken()
Refresh the access token.
client.auth.refreshToken()
getCurrentUser()
Get the current authenticated user profile.
client.auth.getCurrentUser()
forgotPassword(data)
Initiate password reset flow.
client.auth.forgotPassword()
resetPassword(data)
Reset password using a token.
client.auth.resetPassword()
verifyEmail(token)
Verify email using a token.
client.auth.verifyEmail()
resendVerificationEmail()
Resend the verification email to the current user.
client.auth.resendVerificationEmail()
getSAMLUrl(provider, account, relayState?)
Generate SAML SSO authorization URL.
client.auth.getSAMLUrl()
handleSAMLCallback(params)
Handle SAML callback.
client.auth.handleSAMLCallback()
getSAMLMetadata(provider, account)
Get SAML metadata.
client.auth.getSAMLMetadata()
Events
on(event, listener)
Subscribe to authentication events.
auth:login- User logged inauth:logout- User logged outauth:refresh- Token refreshedauth:error- Authentication error
Complete Example
Next Steps
- Type Reference - Type definitions
- Services - Service references
- Configuration - Configuration options