Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gorse-io/gorse-js
TypeScript SDK for gorse recommender system
https://github.com/gorse-io/gorse-js
gorse nodejs typescript
Last synced: about 2 months ago
JSON representation
TypeScript SDK for gorse recommender system
- Host: GitHub
- URL: https://github.com/gorse-io/gorse-js
- Owner: gorse-io
- License: apache-2.0
- Created: 2022-06-05T01:03:15.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-13T11:23:26.000Z (7 months ago)
- Last Synced: 2024-10-06T09:38:26.749Z (3 months ago)
- Topics: gorse, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 43.2 MB
- Stars: 8
- Watchers: 2
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# gorse.js
TypeScript SDK for Gorse recommender system.
[![CI](https://github.com/gorse-io/gorse-js/actions/workflows/ci.yml/badge.svg)](https://github.com/gorse-io/gorse-js/actions/workflows/ci.yml)
[![](https://img.shields.io/npm/v/gorsejs)](https://www.npmjs.com/package/gorsejs)
[![npm](https://img.shields.io/npm/dm/gorsejs)](https://www.npmjs.com/package/gorsejs)## Install
- Install with npm:
```bash
npm install gorsejs
```
- Install with yarn:```bash
yarn add gorsejs
```## Usage
Create a client by the entrypoint and api key.
```js
import { Gorse } from "gorsejs";const client = new Gorse({ endpoint: "http://127.0.0.1:8087", secret: "api_key" });
await client.insertFeedbacks([
{ FeedbackType: 'star', UserId: 'bob', ItemId: 'vuejs:vue', Timestamp: '2022-02-24' },
{ FeedbackType: 'star', UserId: 'bob', ItemId: 'd3:d3', Timestamp: '2022-02-25' },
{ FeedbackType: 'star', UserId: 'bob', ItemId: 'dogfalo:materialize', Timestamp: '2022-02-26' },
{ FeedbackType: 'star', UserId: 'bob', ItemId: 'mozilla:pdf.js', Timestamp: '2022-02-27' },
{ FeedbackType: 'star', UserId: 'bob', ItemId: 'moment:moment', Timestamp: '2022-02-28' }
]);await client.getRecommend({ userId: 'bob', cursorOptions: { n: 10 } });
```