hello-tractor-sdk
v1.0.8
Published
Access the Hello Tractor's API to build your own applications
Downloads
9
Readme
HT SDK
Overview
The HT SDK is a TypeScript-based software development kit designed to interface with Hello Tractor's API, allowing developers to build integrations and services around tractor bookings and management. This SDK provides a simple and robust interface for accessing available tractors, fetching tractor details, and more.
Features
- API Integration: Easily interact with Hello Tractor's API to manage tractors.
- TypeScript Support: Strongly typed for safer and more reliable code.
- Flexible Authentication: Initialize the SDK with an API key to authenticate requests.
- Modular Design: Use only the parts of the SDK you need.
Getting Started
Installation
You can install it via npm:
npm install hello-tractor-sdk
Usage
After installation, you can use the SDK in your project:
import { HTSDK } from "hello-tractor-sdk";
const sdk = HTSDK.init("YOUR-API-KEY");
sdk
.getAvailableTractors()
.then((tractors) => console.log(tractors))
.catch((error) => console.error(error));
Sample Integration with Next.js
If you're using Next.js, you can easily integrate the SDK:
import { useEffect } from "react";
import { HTSDK } from "hello-tractor-sdk";
export default function Home() {
useEffect(() => {
const sdk = HTSDK.init("YOUR-API-KEY");
sdk
.getAvailableTractors()
.then((tractors) => console.log(tractors))
.catch((error) => console.error(error));
}, []);
return <div>Welcome to the Tractor Booking Page</div>;
}
Documentation
This package is part of the Hello Tractor API ecosystem. For more information, please refer to the official documentation.