1.1.0 • Published 1 year ago

@quantix-ict/exact-online v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Exact online client by Quantix

A library to use the exact online API.

Installation and Usage

Installation:

npm i @quantix-ict/exact-online

Usage:

const { Exact } = require('@quantix-ict/exact-online')

const exact = new Exact({
  clientId: 'CLIENT_ID',
  clientSecret: 'CLIENT_SECRET',
  redirectUri: 'https://example.com/exact-online/connect',
})

await exact.initialize()

const data = await exact.request({
  endpoint: '/project/Projects',
  params: {
    $filter: 'Type eq 1',
  },
  method: 'GET', // optional, uses 'GET' by default
  division: '1234567', // optional, uses current division by default
})

of using import:

import { Exact } from '@quantix-ict/exact-online'

const exact = new Exact({
  clientId: 'CLIENT_ID',
  clientSecret: 'CLIENT_SECRET',
  redirectUri: 'https://example.com/exact-online/connect',
})

await exact.initialize()

const data = await exact.request({
  endpoint: '/project/Projects',
  params: {
    $filter: 'Type eq 1',
  },
  method: 'GET', // optional, uses 'GET' by default
  division: '1234567', // optional, uses current division by default
})

Connecting to exact online

  1. Get the login url:
const loginUrl = exact.getLoginUrl({
  responseType: 'code', // optional, 'code' by default
  forceLogin: true, // optional, false by default
})
  1. Redirect the user to the loginUrl.

  2. User performs login in exact environment. And gets redirected to redirectUri (https://example.com/exact/connect?code=ascjen4)

  3. Send code from URL Params to the backend.

  4. Call connect with the code on the backend.

const connected = await exact.connect(code)

Exact online API documentation

You can find the Exact online API documentation here.

More information about the API can be found here.

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago