Skip to main content

Quick Start

1

Create Your React Project

Choose your preferred bundler:
2

Install Dependencies

3

Start Development

Configuration

Add this configuration to your vite.config.js:
Based on your build tool and/or framework, you may have a different prefix to the environment variables, e.g. if you’re using Vite, your env prefix is going to be “VITE_” instead of “REACT_APP_”
Create a .env file with your credentials:

Integration with React

Custom Hook Implementation

Best Practices

Error Handling

  • Always handle token generation errors - Provide meaningful error messages
  • Implement proper error boundaries

Security

  • Never expose API keys in client-side code
  • Use environment variables
  • Implement proper token management

Performance

  • Use React.memo for expensive renders
  • Implement proper cleanup in useEffect
  • Avoid unnecessary re-renders

State Management

  • Use proper state management patterns
  • Implement loading states
  • Handle edge cases properly
Remember to handle token expiration and implement proper refresh mechanisms in a production environment.

Troubleshooting

  • Token Generation Fails: Verify your credentials and network connection
  • SDK Initialization Errors: Check configuration object format
  • Component Re-rendering: Implement proper memoization
  • Vite: Ensure variables are prefixed with VITE_
  • Create React App: Ensure variables are prefixed with REACT_APP_
  • Development: Verify .env file location

Next Steps

Sample Implementation

View complete implementation examples

API Reference

Explore the complete API documentation