Hawcx Authentication SDK API Reference

Core Components

HawcxInitializer

Authentication Methods

Response Object

All authentication methods return an AuthResponse object:

{
  success: boolean,        // Operation success status
  message: string,         // Human-readable result message
  errorCode: string|null,  // Error code if failed, null otherwise
  data: object|null        // Additional operation data
}

Error Codes

CodeDescription
NOT_INITIALIZEDSDK not initialized
INVALID_EMAILInvalid email format
MISSING_OTPNo verification code provided
OTP_VERIFICATION_FAILEDInvalid verification code
USER_NOT_FOUNDUser does not exist
DEVICE_NOT_REGISTEREDCurrent device not registered
CLIENT_ERRORClient-side error
EXISTING_USERUser already exists

Code Examples

Multi device flow

In order to register multiple devices under the same user account, an additional function called addDevice should be called. The flow is documented below:

Fig: Step-by-step flow for registering and authenticating multiple devices for a single user account

That’s it for the API reference. We’re actively improving the SDK and have some exciting improvements coming up in future releases. Please feel free to message us on Slack for support as well as feedback.

Try it out!

Example App

Check out our example app on GitHub for a complete implementation.