Skip to content

Commit 0ed1c24

Browse files
committed
Fix: Do not use process.env as it is not available in browser-side JS
1 parent abc3f47 commit 0ed1c24

10 files changed

+79
-271
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The library is [UMD](https://github.com/umdjs/umd) compatible.
1515
You can download [recombee-api-client.min.js](./dist/recombee-api-client.min.js) and host it at your site, or use a CDN such as [jsDelivr](https://www.jsdelivr.com/) CDN:
1616

1717
```js
18-
<script src="https://cdn.jsdelivr.net/gh/recombee/[email protected].0/dist/recombee-api-client.min.js"></script>
18+
<script src="https://cdn.jsdelivr.net/gh/recombee/[email protected].1/dist/recombee-api-client.min.js"></script>
1919
```
2020

2121
### npm
@@ -170,7 +170,7 @@ Let's assume we want to show recommendations at product page of pants `product-2
170170
</div>
171171
</div>
172172

173-
<script src="https://cdn.jsdelivr.net/gh/recombee/[email protected].0/dist/recombee-api-client.min.js"></script>
173+
<script src="https://cdn.jsdelivr.net/gh/recombee/[email protected].1/dist/recombee-api-client.min.js"></script>
174174

175175
<script type="text/javascript">
176176

dist/recombee-api-client.js

Lines changed: 67 additions & 259 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/recombee-api-client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/recombee-api-client.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/recombee-api-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "recombee-js-api-client",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Client-side js library for easy use of the Recombee recommendation API",
55
"browser": "./src/index.js",
66
"repository": {

src/api-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ApiClient {
1818
this.databaseId = databaseId;
1919
this.publicToken = publicToken;
2020
this.options = options || {};
21-
this.baseUri = this.options.baseUri || process.env.RAPI_URI || 'client-rapi.recombee.com';
21+
this.baseUri = this.options.baseUri || 'client-rapi.recombee.com';
2222
this.useHttps = ('useHttps' in this.options) ? this.options.useHttps : true;
2323
this.async = ('async' in this.options) ? this.options.async : true;
2424
}

src/requests/recommend-items-to-item.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const rqs = require("./request");
88
/**
99
* Recommends set of items that are somehow related to one given item, *X*. Typical scenario is when user *A* is viewing *X*. Then you may display items to the user that he might be also interested in. Recommend items to item request gives you Top-N such items, optionally taking the target user *A* into account.
1010
* It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
11-
* The returned items are sorted by relevancy (first item being the most relevant).
11+
* The returned items are sorted by relevance (first item being the most relevant).
1212
*/
1313
class RecommendItemsToItem extends rqs.Request {
1414

@@ -117,7 +117,7 @@ class RecommendItemsToItem extends rqs.Request {
117117
* - Description: **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
118118
* - *minRelevance*
119119
* - Type: string
120-
* - Description: **Expert option** If the *targetUserId* is provided: Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested relevancy, and may return less than *count* items when there is not enough data to fulfill it.
120+
* - Description: **Expert option** If the *targetUserId* is provided: Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested relevance, and may return less than *count* items when there is not enough data to fulfill it.
121121
* - *rotationRate*
122122
* - Type: number
123123
* - Description: **Expert option** If the *targetUserId* is provided: If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended items.

src/requests/recommend-items-to-user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const rqs = require("./request");
99
* Based on user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for a given user.
1010
* The most typical use cases are recommendations at homepage, in some "Picked just for you" section or in email.
1111
* It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
12-
* The returned items are sorted by relevancy (first item being the most relevant).
12+
* The returned items are sorted by relevance (first item being the most relevant).
1313
*/
1414
class RecommendItemsToUser extends rqs.Request {
1515

@@ -102,7 +102,7 @@ class RecommendItemsToUser extends rqs.Request {
102102
* - Description: **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
103103
* - *minRelevance*
104104
* - Type: string
105-
* - Description: **Expert option** Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested relevancy, and may return less than *count* items when there is not enough data to fulfill it.
105+
* - Description: **Expert option** Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested relevance, and may return less than *count* items when there is not enough data to fulfill it.
106106
* - *rotationRate*
107107
* - Type: number
108108
* - Description: **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended items. Default: `0.1`.

src/requests/search-items.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const rqs = require("./request");
1010
* All the string and set item properties are indexed by the search engine.
1111
* This endpoint should be used in a search box at your website/app. It can be called multiple times as the user is typing the query in order to get the most viable suggestions based on current state of the query, or once after submitting the whole query.
1212
* It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
13-
* The returned items are sorted by relevancy (first item being the most relevant).
13+
* The returned items are sorted by relevance (first item being the most relevant).
1414
*/
1515
class SearchItems extends rqs.Request {
1616

0 commit comments

Comments
 (0)