Angular
This guide walks you through integrating OneSDK with a new Angular project, providing a robust foundation for building KYC/AML features in your Angular application.
Quick Setup
Webpack Configuration
TypeScript Configuration
Configure TypeScript
Update your tsconfig.json or tsconfig.app.json:
Implementation
Note: The sample code below is just an example. Never generate tokens on the frontend — doing so can expose your credentials. Always generate tokens securely on your backend and pass them to your app as needed.
Component Setup
Template Setup
app.component.ts
Running the Application
Security Note
Never store API keys or credentials in your frontend code. Use environment variables and a secure backend service to handle authentication.
Troubleshooting
Common Issues
- Webpack Configuration Errors: Ensure all loaders are properly configured in webpack.config.js
- TypeScript Errors: Verify tsconfig.json settings, especially
allowSyntheticDefaultImports - Component Mounting Issues: Check if container IDs match in both component and template files
Best Practices
- Use environment variables for API keys and endpoints
- Implement proper error handling for API calls
- Follow Angular’s lifecycle hooks for initialization
- Implement proper cleanup in ngOnDestroy
Need Help?
If you encounter issues, check our sample code repository or reach out to our support team.
