Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bosta.co

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bosta.co

A package for managing integration with bost.co a courier with cash collection provider

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

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

Bosta.co

A Package for managing integration with the bosta.co courier and cash on delivery provided by bost.co for lack of an official one.

Build Status Coverage Status NSP Status

Getting Started

npm install bosta.co

Include your paymob accept credentials in a gitingnored .env or configuration file

// config.js
module.exports = {
  API_KEY: process.env.BOSTA_API_KEY || "-----------------"
}

Import the bosta.co instance and configure it

import Bosta, { DELIVERY_STATES, DELIVERY_TYPES, CITIES } from "bosta.co"
// or in node < 10 you can
// const { Bosta } = require("bosta.co")
// const Bosta = require("bosta.co").default

//... later in your code
/**
requestDelivery({
   *  apiKey: String, // don't need to include if  process.env.BOSTA_API_KEY is set
   *  amount: Number, // the amount to be picked up (includes bosta's fee) optional in case of package delivery
   *  city: String, // Bosta enum for suported cities required if using address as string
   *  address: String | Address, // string of addressline or address object of the form { firstLine: String, city: String, geoLocation?: { lat: Number, lng: Number}, secondLine?: String, floor?: Number, appartment?: Number, zone?: String, District?: String } with firstLine being
   *  pickupAddress?: Address, // where the package is to be picked up from or cash to be collected from depending on delivery type
   *  deliveryAddress?: Address, // where package is to be delivered
   *  receiver: receiver, // who the delivery is ment for, object of the form { firstName: String, lastName: String, phone: String, email?: String } optional if name, phone is set
   *  name: String, // reciever first and last name required in case reciever object not set
   *  phone: String, // reciever phone required in case reciever object not set
   *  notes?: String, // A note for the courrier
   *  businessReference?: String, // an id for your personal use in your system
   *  webhookUrl?: String, // a url that will recieve a wehookStateUpdate post request
   * })
   * 
   */
await Bosta.requestDelivery({
  apiKey: process.env.BOSTA_API_KEY, // this is the default
  type: DELIVERY_TYPES.CASH_COLLECTION.code,
  address: "7 Almaza square, Heliopolis, Cairo",
  amount: 40,
  city: CITIES.CAIRO.code,
  name: "Amr Draz",
  phone: "+200201020202",
})

await Bosta.collect({...}) // same as requestDelivery but sets type to CASH_COLLECTION,
await Bosta.deliver({...}) // same as requestDelivery but sets type to PACAKGE_DELIVERY,

See tests for the rest of the available functions.

This package has partial coverage of the bosta API requesting cash on delivery and cash collection.

The package is maintianed by DREIDEV and is not an offical bosta.co package

Licence MIT

Keywords

FAQs

Package last updated on 21 May 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc