Frontend SDK
Error Handling
Handle errors and troubleshoot issues with React nekuda.js
Error Handling
It’s important to handle potential errors that can occur during the payment process or SDK initialization.
Submission Errors
When using elements.submit()
, always include a try...catch
block to handle submission failures. These can occur due to invalid input, network issues, or other processing problems.
Initialization Errors
The useNekudaWallet()
hook provides an error
state that indicates if there was an issue initializing the wallet, often due to an invalid public key or network problems preventing the SDK from loading necessary resources.
Troubleshooting
- Check Browser Console: Look for any error messages or warnings in your browser’s developer console. These often provide clues about integration problems.
- Verify Public Key: Ensure that the
publicKey
you are using is correct, valid, and matches the environment (test/live) you intend to use. - Iframe Blocking: Confirm that no browser extensions, corporate firewalls, or Content Security Policies (CSP) are blocking the loading or functioning of the iframes from Nekuda’s domains.
- SDK Version: Ensure you are using a compatible and up-to-date version of the
@nekuda/react-nekuda-js
.
For further assistance, please refer to the Nekuda Support Portal or contact our support team.