- 
                Notifications
    
You must be signed in to change notification settings  - Fork 9
 
Add minimal fallback mechanism documentation for JS API search integrations #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Techdocs
Are you sure you want to change the base?
Changes from 5 commits
a6dd4ab
              4a191c8
              05c91c8
              96a092f
              07f80c7
              2f44a2a
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -388,4 +388,23 @@ Tracking product clicks is fundamental for understanding user interaction. Use ` | |
| 
     | 
||
| In case of an SPA based integration the `api.recordSearchClick` calls should be complemented with Session API or `api.createRecommendationRequest()` usage to couple the search analytics events to generic Nosto events for accurate attribution. | ||
| 
     | 
||
| ## Fallback mechanism | ||
| 
     | 
||
| For JS API integrations, there is no built-in fallback functionality. Merchants need to build this themselves to ensure a robust search experience. | ||
| 
     | 
||
| ### When to implement fallbacks | ||
| 
     | 
||
| You should implement fallback mechanisms in the following scenarios: | ||
| 
     | 
||
| * **Search query errors**: When the search API returns an error response | ||
| * **Timeout scenarios**: When the search query takes longer than 1 second to return results | ||
| * **Network connectivity issues**: When there are network problems preventing API calls | ||
| 
     | 
||
| ### Implementation considerations | ||
| 
     | 
||
| * **Error handling**: Always wrap Nosto search calls in try-catch blocks | ||
| * **Timeout management**: Implement reasonable timeout values (recommended: 1 second) | ||
                
       | 
||
| * **User experience**: Ensure seamless transition to fallback without visible errors | ||
| * **Analytics**: Track fallback usage to monitor search performance | ||
| 
     | 
||
| *** | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mention that JS API based Search requests timeout after 5 seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the timeout scenario to mention that JS API based Search requests timeout after 5 seconds as requested. The line now provides accurate information about the actual API timeout behavior. Changes committed in b9c4f21.