Socket
Socket
Sign inDemoInstall

ts-shipment-tracking

Package Overview
Dependencies
38
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ts-shipment-tracking

Unified shipment tracking data from FedEx, UPS, and USPS APIs.


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

ts-shipment-tracking

Unified shipment tracking data from FedEx, UPS, and USPS APIs.

Table of Contents
  1. About
  2. Installation
  3. Usage
  4. Built With
  5. Acknowledgements

About

Returns a unified response from FedEx, UPS, and USPS tracking APIs.

Installation

$ npm install ts-shipment-tracking

Usage

Courier API credentials are stored using dotenv. If you do not have dotenv installed:

$ npm install dotenv

Add the following credentials to your .env file:

FEDEX_KEY=
FEDEX_PASSWORD=
FEDEX_ACCOUNT_NUMBER=
FEDEX_METER_NUMBER=
UPS_ACCESS_LICENSE_NUMBER=
USPS_USER_ID=

Example input:

import 'dotenv/config';
import { TrackingInfo, track, trackByCourier, trackFedex } from 'ts-shipment-tracking';

(async () => {
  const exampleOne: TrackingInfo | undefined = await track('<any_tracking_number>');
  console.log(exampleOne);

  // or

  const exampleTwo: TrackingInfo | undefined = await trackByCourier('ups', '<ups_tracking_number>');
  console.log(exampleTwo);

  // or

  const exampleThree: TrackingInfo | undefined = await trackFedex('<fedex_tracking_number>');
  console.log(exampleThree);
})();

Example output:

{
  events: [
    {
      status: 'IN_TRANSIT',
      label: 'Arrived at FedEx location',
      location: 'LEBANON TN US 37090',
      date: 1616823540000
    },
    ...
  ],
  estimatedDeliveryDate: 1616996340000
}

Statuses:

'UNAVAILABLE'
'LABEL_CREATED'
'IN_TRANSIT'
'OUT_FOR_DELIVERY'
'DELIVERY_ATTEMPTED'
'RETURNED_TO_SENDER'
'EXCEPTION'
'DELIVERED'

Built With

Acknowledgements

Keywords

FAQs

Last updated on 26 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc