New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tearex

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tearex

This package provides a NodeJS SDK for the [tearex.ai](https://tearex.ai) Recommendation Engine API. If you don't have a tearex.ai account, you can request one here: [tearex.ai](https://tearex.ai/#contact).

  • 0.1.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-61.9%
Maintainers
1
Weekly downloads
 
Created
Source

TeaRex AI NodeJS SDK

This package provides a NodeJS SDK for the tearex.ai Recommendation Engine API. If you don't have a tearex.ai account, you can request one here: tearex.ai.

Documentation

For more information about the API, please refer to the documentation.

Installation

To install the SDK, run the following command:

npm install --save tearex

Usage

Import the SDK:

const trx = require('tearex');

Initialize the SDK

Provide the url of the API and your API KE as an environment variable TEAREX_URL and TEAREX_API_KEY, or pass them as an argument to the init function:

trx.init({uri: 'YOUR_TEAREX_API_URL', apiKey: 'YOUR_TEAREX_API_KEY'});

Example

import trx from 'tearex';

// Initialize the tearex
trx.init()

const alice = {id: 'user-1', label: 'User', properties: {name: 'Alice'}}
const kale = {id: 'product-2', label: 'Product', properties: {name: 'Kale'}}

// Create Alice since she is a new user
(async () => {
    await trx.createEntity(alice)
    
    // Alice purchases Kale, so we create the "Purchased" event
    await trx.createEvent(alice, "Purchased", kale)
    
    // Recommend Alice the next "Product" to purchase
    await trx.recommend(alice, "Product")
})()

Keywords

FAQs

Package last updated on 28 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc