Getting started

Installation

The redivis library is hosted on NPM. Use npm to install, or specify redivis-js in your package.json
1
npm install --save redivis
Copied!

Authentication

The redivis-js library supports two forms of authentication: API token and OAuth
The OAuth flow is recommended for interactive sessions, and will automatically prompt you (or the end user) to authenticate with their Redivis credentials. If you're using the redivis-js library in a browser, a popup will appear when authorization is required. If using it in a Node.js environment, a URL will be printed

API Token

For non-interactive usage of the redivis-js library (in a Node.js environment), you can use an API token stored as an environment variable for authorization.
First, follow the steps to generate an API Token. This API token must then be set as the REDIVIS_API_TOKEN environment variable before executing your script. You can set the variable for your current session by running the following in your terminal:
1
export REDIVIS_API_TOKEN=YOUR_TOKEN
Copied!

Usage

1
import * as redivis from redivis
2
3
data = await redivis
4
.organization('demo')
5
.dataset('nyt covid us cases_deaths')
6
.table('covid_us states')
7
.listRows({ maxResults: 100 })
Copied!
When referencing datasets, projects, and tables on Redivis, you should be familiar with the resource reference syntax.
Last modified 18d ago