@recomnext/browser 0.3.4-dev.94b8290b → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ const recomnext = new RecomnextBrowserClient({
|
|
|
30
30
|
baseUrl: '/api',
|
|
31
31
|
tenantId: 'my-tenant',
|
|
32
32
|
userId: 'user-123', // optional
|
|
33
|
+
country: 'IN', // optional ISO-2 default for recommend + track*
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
// Get recommendations
|
|
@@ -46,10 +47,11 @@ const { suggestions } = await recomnext.autocomplete('xbo', { limit: 8 });
|
|
|
46
47
|
const catalog = await recomnext.listItems({ limit: 40, category: 'games' });
|
|
47
48
|
const categories = await recomnext.getCategories();
|
|
48
49
|
|
|
49
|
-
// Track events
|
|
50
|
+
// Track events (optional country overrides the client default)
|
|
50
51
|
recomnext.trackView('product-1');
|
|
51
|
-
recomnext.trackCart('product-1');
|
|
52
|
+
recomnext.trackCart('product-1', { country: 'DE' });
|
|
52
53
|
recomnext.trackPurchase('product-1');
|
|
54
|
+
recomnext.setCountry('IN');
|
|
53
55
|
|
|
54
56
|
// Automatic impression tracking
|
|
55
57
|
const cleanup = recomnext.trackImpressions(document.querySelector('.recs-container'), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recomnext/browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Lightweight browser SDK for recomnext — recommendations, event tracking, and impression tracking",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/recomnext-browser.umd.js",
|