0.3.8 • Published 4 months ago

tracktik-sdk v0.3.8

Weekly downloads
848
License
none
Repository
github
Last release
4 months ago

TrackTik JavaScript SDK

The TrackTik JavaScript SDK is a lightweight, promise based interface to the TrackTik v1 API that works in both nodejs and browser environments. It provides common services for making API requests and helper utilities.

Documentation

Please view our full JavaScript SDK documentation at https://github.com/TrackTik/tracktik-sdk-js.

Quickstart

Install the latest version of the SDK

# instalation
npm install tracktik/tracktik-sdk#master --save
#or
yarn add tracktik/tracktik-sdk#master

Import the library using ES6 syntax

import Api, { RestApiConnectorAuth } from "tracktik-sdk";

ES5 and require to load the SDK

var SDK = require('tracktik-sdk');
var Api = SDK.default
var RestApiConnectorAuth = SDK.RestApiConnectorAuth

Once the module was imported, procceed to authenticate with the REST API

const connector = await RestApiConnectorAuth({ username: 'foo', password:'bar' })
const api = new Api(connector)

With the Api initialized, the next step is to consume the API resources.

//Create entity
const newEmployee = await api.employees.create({
  firstName: 'bob',
  lastName: 'security'
})

//Update entity
const updatedEmployee = await api.employees.update(employee.id, {
  firstName: 'alice',
  lastName: 'guard'
})

//Edit entity
const editedEmployee = await api.employees.edit(employee.id, {
  lastName: 'officer'
})

//Get one entity
const aliceEmployee = await api.employee.get(employee.id)

//Get a collection of entities
const collection = await api.employee.getAll({
  filters: [{
    field: 'lastName',
    operator: 'eq',
    value: 'officer'
  }]
})

Contributing

Please see CONTRIBUTING.md for information on how to contribute, setup the development environment and run tests.

Versioning

We will try to follow semver as close as possible. That means bug fixes will be patch releases (1.0.1 -> 1.0.2), additional functionality like new endpoints will be minor releases (1.0.1 -> 1.1.0) and breaking changes to both the library and the API endpoints it hits, will be major releases (1.0.1 -> 2.0.0).

0.3.8

4 months ago

0.3.7

5 months ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.4

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.3

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.7

4 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago