Error Handling

It’s important to handle potential errors that can occur during the secure information collection 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.

Card Management Errors

When using the card management features, specific errors may occur during card operations:

Common Card Management Error Scenarios

  1. Authentication Errors (401): User session expired or invalid API key
  2. Rate Limiting (429): Too many requests in a short period
  3. Server Errors (5xx): Temporary service unavailability
  4. Network Errors: Connection issues or timeouts
  5. Validation Errors: Invalid card data or expired cards

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.