{"id":18469745,"url":"https://github.com/anatelli10/ts-shipment-tracking","last_synced_at":"2025-04-08T10:32:52.562Z","repository":{"id":57381159,"uuid":"395129700","full_name":"0xA-10/ts-shipment-tracking","owner":"0xA-10","description":"📦 Unified shipment tracking data from FedEx, UPS, and USPS APIs.","archived":false,"fork":false,"pushed_at":"2025-01-15T23:00:05.000Z","size":182,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T01:03:28.063Z","etag":null,"topics":["fedex","package-tracking","shipment-tracking","ups","usps"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xA-10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-11T22:21:21.000Z","updated_at":"2025-01-11T22:49:21.000Z","dependencies_parsed_at":"2023-12-29T02:23:45.061Z","dependency_job_id":"ecea5363-9156-4bd3-a371-bf34e3f8092b","html_url":"https://github.com/0xA-10/ts-shipment-tracking","commit_stats":{"total_commits":64,"total_committers":2,"mean_commits":32.0,"dds":0.390625,"last_synced_commit":"d0cd254001849674b9d3ca9ded8613e49025052a"},"previous_names":["0xa-10/ts-shipment-tracking","anatelli10/ts-shipment-tracking"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xA-10%2Fts-shipment-tracking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xA-10%2Fts-shipment-tracking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xA-10%2Fts-shipment-tracking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xA-10%2Fts-shipment-tracking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xA-10","download_url":"https://codeload.github.com/0xA-10/ts-shipment-tracking/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247824284,"owners_count":21002242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fedex","package-tracking","shipment-tracking","ups","usps"],"created_at":"2024-11-06T10:11:40.111Z","updated_at":"2025-04-08T10:32:51.640Z","avatar_url":"https://github.com/0xA-10.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003ets-shipment-tracking\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Unified shipment tracking data from FedEx, UPS, and USPS APIs.\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## API Versions\n\n_FedEx:_ Track API 1.0.0 (https://apis.fedex.com/track/v1)\n\n_UPS:_ Track API v1 (https://onlinetools.ups.com/api/track/v1)\n\n_USPS:_ Package Tracking and Notification 3.2.1 (https://api.usps.com/tracking/v3/tracking)\n\n## Installation\n\n```sh\n$ npm install ts-shipment-tracking\n```\n\n## Usage\n\nCourier API credentials are stored using dotenv. If you do not have dotenv installed:\n\n```sh\n$ npm install dotenv\n```\n\nCopy the contents of [.env.template](.env.template) into your `.env` file and fill it out.\n\nExample input:\n\n```ts\nimport \"dotenv/config\";\nimport { track, TrackingInfo } from \"ts-shipment-tracking\";\n\n(async () =\u003e {\n  // With automatic courier detection\n  try {\n    const tragnostic: TrackingInfo = await track(\"\u003cany_tracking_number\u003e\");\n\n    console.log(tragnostic);\n  } catch (err) {\n    console.log((err as Error).message);\n  }\n\n  // With explicitly specified courier\n  try {\n    const tracking: TrackingInfo = await track(\n      \"\u003cups_tracking_number\u003e\",\n      // Supports autocomplete!\n      { courierCode: \"ups\" }\n    );\n\n    console.log(tracking);\n  } catch (err) {\n    console.log((err as Error).message);\n  }\n})();\n```\n\nExample output:\n\n```jsonc\n{\n  events: [\n    {\n      status: 'IN_TRANSIT',\n      label: 'Arrived at FedEx location',\n      location: 'LEBANON TN US 37090',\n      time: 1616823540000\n    },\n    // ...\n  ],\n  estimatedDeliveryTime: 1616996340000\n}\n```\n\nAll statuses:\n\n```ts\nexport enum TrackingStatus {\n  LABEL_CREATED = \"LABEL_CREATED\",\n  IN_TRANSIT = \"IN_TRANSIT\",\n  OUT_FOR_DELIVERY = \"OUT_FOR_DELIVERY\",\n  DELIVERY_ATTEMPTED = \"DELIVERY_ATTEMPTED\",\n  RETURNED_TO_SENDER = \"RETURNED_TO_SENDER\",\n  EXCEPTION = \"EXCEPTION\",\n  DELIVERED = \"DELIVERED\",\n}\n```\n\nAPI environment is determined by `process.env.NODE_ENV` (\"development\" or \"production\"). It can be overridden like so: \n\n```ts\nawait track(\"\u003ctracking_number\u003e\", { env: myProductionFlag ? \"production\" : \"development\" });\n```\n\n## Acknowledgements\n\nThanks to @rjbrooksjr's [TS Tracking Number](https://github.com/rjbrooksjr/ts-tracking-number) module being used for tracking number validation and courier detection.\n\nThanks to @hautelook's [Shipment Tracking](https://github.com/hautelook/shipment-tracking) repo used as a reference for some gaps in courier status codes as well as inspiration for architecture.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatelli10%2Fts-shipment-tracking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanatelli10%2Fts-shipment-tracking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatelli10%2Fts-shipment-tracking/lists"}