@quantix-ict/exact-online
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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.

Package Sidebar

Install

npm i @quantix-ict/exact-online

Weekly Downloads

78

Version

1.1.0

License

ISC

Unpacked Size

32.5 kB

Total Files

14

Last publish

Collaborators

  • quantix-ict