User Context in Marketplace Apps
The HoopAI Platform provides a secure mechanism for accessing authenticated user information through signed tokens. This guide explains how to generate and use a Shared Secret key to access user context securely.
Setting Up Shared Secret
Generating a Shared Secret Key
- Navigate to your application’s Advanced Settings.
- Go to the Auth section.
- Under Shared Secret, click the Generate button to create your Shared Secret key.
Frontend Implementation Methods
There are two ways to access this data in your frontend, depending on where your code runs.
1. Custom JavaScript Implementation
If you are using custom JavaScript injected into HoopAI Platform pages, use the exposeSessionDetails method:
2. Custom Pages Implementation
If you are trying to get user context in a custom page, use the postMessage method to communicate with the parent window:
Backend Implementation
Regardless of which frontend method you use, the backend decryption process is the same:
Decrypted Data Structure
After decryption, the data is returned as a JSON object containing user information. The structure varies based on whether the user is accessing from a Company or Location context.
Company Context
Location Context
Field Descriptions
Security Considerations
- Never expose your Shared Secret key in client-side code.
- Always perform decryption on your backend.
- Store your Shared Secret key securely using environment variables.
- Use HTTPS for all communications between your frontend and backend.
- Regularly rotate your Shared Secret keys for enhanced security.
Last modified on March 7, 2026