amhawy-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

amhawy-sdk

This is an SDK package for Mahaseel Amhawy API.

To get started simply install it:

npm install amhawy-sdk

Then import the Client or Auth to begin.

Example:

import { Client, isHttpError, getHttpErrorInfo } from 'amhawy-sdk'

async function test() {
  const client = new Client('accessToken')

  try {
    const data = await client.Crops.getCrops()
    data.data.name_ar // Outputs crop name

    client.setAccessToken('newToken') // set new token.
    client.addHeader('Header Name', 'Header Value') // add header.
  } catch (error) {
    if (isHttpError(e)) console.log(getHttpErrorInfo(e))
  }
}

Package Sidebar

Install

npm i amhawy-sdk

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

64 kB

Total Files

55

Last publish

Collaborators

  • ahmedkhaled4d
  • minasameh