Skip to content

cvisionai/tator-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b55a830 · Mar 11, 2025
Mar 7, 2023
Mar 30, 2023
Mar 11, 2025
Sep 13, 2023
Oct 28, 2022
Mar 7, 2023
Feb 23, 2024
Oct 26, 2022
Mar 7, 2023
Nov 9, 2024

Repository files navigation

tator

JavaScript client for Tator.

Installation

npm install tator

Usage

Node

let tator = require('tator');
let api = tator.getApi('https://cloud.tator.io', TOKEN);

// For ES6 class object output
api.getMediaList(PROJECT).then(medias => console.log(medias));

// For raw JSON output
api.getMediaListWithHttpInfo(PROJECT).then(info => console.log(info.response.body));

Browser

import { getApi } from 'tator';
let api = getApi('https://cloud.tator.io', TOKEN);

// For ES6 class object output
api.getMediaList(PROJECT).then(medias => console.log(medias));

// For raw JSON output
api.getMediaListWithHttpInfo(PROJECT).then(info => console.log(info.response.body));

This will generate code using the schema at https://cloud.tator.io. If you are a tator developer, call make js-bindings from the main tator project (for which this project is a submodule) and it will use the schema from the local backend image.

Building (developers only)

make build

Run examples (developers only)

cd pkg
node examples/setup-project.js -h

Note that example scripts must be run from the build directory pkg as they use relative imports.

Run tests (developers only)

HOST=https://local.tator.io TOKEN=yourtoken make test

Authors

Tator and tator-js are developed by CVision AI.