KindeProvider Usage
I would like to know what is the use of using the KindeProvider component, since I just found out that it exists and my app works perfectly and maintains the user session without using the component.
2 Replies
Hi @disamdev
The KindeProvider is a React Context Provider that maintains Kinde's internal state in your application.
Key benefits of using KindeProvider include:
State Management
-Maintains authentication state across your application
-Handles token refreshing automatically
Access to Helper Functions
The provider gives you access to important helper functions:
-getPermission and getPermissions for checking user permissions
-getFlag for feature flags
-getClaim for accessing token claims
-getToken for accessing the bearer token
Security Features
By default, KindeProvider:
-Stores JWTs in memory to protect against CSRF and XSS attacks
-Provides secure token management
While your app may work without KindeProvider, you might be missing out on these built-in security features and helper functions that make working with Kinde more secure and convenient.
Important Security Note
If you're not using KindeProvider, you should ensure you're implementing proper token storage and security measures yourself, as tokens contain sensitive authentication information that needs to be properly protected against common web vulnerabilities.
Hope this helps,
Claire
Thank you so much for the info
Going to implement it