8000 R2R/js/README.md at main · blahmountain/R2R · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 996 Bytes

README.md

File metadata and controls

42 lines (29 loc) · 996 Bytes

R2R JavaScript SDK Documentation

For the complete look at the R2R JavaScript SDK, visit our documentation.

Installation

Before starting, make sure you have completed the R2R installation.

Install the R2R JavaScript SDK:

npm install r2r-js

Getting Started

  1. Import the R2R client:
const { r2rClient } = require('r2r-js');
  1. Initialize the client:
const client = new r2rClient('http://localhost:7272');
  1. Check if R2R is running correctly:
const healthResponse = await client.health();
// {"status":"ok"}
  1. Login (Optional):
// client.register("me@email.com", "my_password"),
// client.verify_email("me@email.com", "my_verification_code")
client.login("me@email.com", "my_password")

When using authentication the commands below automatically restrict the scope to a user's available documents.

0