Skip to content

dfpc-coe/node-tak

Repository files navigation

Node-TAK

Javascript TAK Server Library

Lightweight JavaScript library for managing TAK TLS connections for streaming CoT data as well as a typed SDK for performing TAK Server REST API operations

API Documentation

API Documentation for the latest version can be found on our Github Pages Site

Or generated locally with

npm run doc

Installation

NPM

To install node-tak with npm run

npm install @tak-ps/node-tak

or for use with the global CLI:

npm install --global @tak-ps/node-tak

CLI Usage Examples

Initial Setup

The initial run of the CLI will generate a new Connection Profile & Credentials

tak

Once the profile is generated you can specify it with --profile <profile> in any command or if it is not provided it will be interactively requested

Streaming COTs

tak stream

API Operations

Example of a couple different operations:

tak <command> <subcommand>
tak mission list
tak package list

Command Line Args

The following command line args are supported by all or many of the different command modes

Use custom P12 cert file

--auth <p12 file to use>

Output Raw JSON where possible

--format json

Environment Variables

Variable Notes
TAK_P12_PASSWORD Avoid the P12 Password prompt when using in a script

SDK Usage Examples

Basic Streaming COT Usage

import TAK from '@tak-ps/node-tak';

const tak = await TAK.connect('ConnectionID', new URL('https://tak-server.com:8089'), {
    key: conn.auth.key,
    cert: conn.auth.cert
});

tak.on('cot', async (cot: CoT) => {
    console.error('COT', cot); // See node-cot library
}).on('end', async () => {
    console.error(`Connection End`);
}).on('timeout', async () => {
    console.error(`Connection Timeout`);
}).on('ping', async () => {
    console.error(`TAK Server Ping`);
}).on('error', async (err) => {
    console.error(`Connection Error`);
});

Basic API Usage

import { TAKAPI, APIAuthCertificate } from '@tak-ps/node-tak'

const api = await TAKAPI.init(new URL('TAK SERVER Marti API & Port'), new APIAuthCertificate(auth.cert, auth.key));

const missions = await api.Mission.list(req.query);

console.error(missions);

About

TAK Server NodeJS SDK

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •