@airsoko/react
TypeScript icon, indicating that this package has built-in type declarations

0.0.4Β β€’Β PublicΒ β€’Β Published

Airsoko react package

πŸ“‘ Table of Contents

Table

Overview

The npm package provides essential utilities for handling react within the Airsoko application.

Installation

npm install @airsoko/react

Prerequisites

  • Node.js (version 16 or higher)
  • npm (or yarn)

Uninstalling

If you wish to uninstall Airsoko next, use:

npm uninstall  @airsoko/react

API Reference

Example

Step 1: Wrap the Application with AirsokoReactProvider

To enable authentication within your React application, you need to wrap it with the AirsokoReactProvider component provided. This component sets up the necessary react context, allowing your components to access shop information.

Here's an example of how to use the AirsokoReactProvider:

import { CartProvider, CheckoutProvider, AirsokoReactProvider, WishlistProvider } from "@airsoko/react";
import App, { AppProps } from "next/app";

export default function MyApp({ Component, pageProps }: AppProps) {
  return (
    <>
      <AirsokoReactProvider
        storeDomain={'myshop.airsoko.com'}
        storefrontToken="mytoken"
        storefrontApiVersion="2024-01"
        countryIsoCode="US"
        languageIsoCode="EN"
      >
        <CartProvider>
          <CheckoutProvider
            deliveryLocationDefaultOptions={{
              country: "KE",
              county: "Nairobi",
              town: "CBD - GPO/City Market/Nation Centre",
              selectedOption: {
                type: "pickup",
                minimumDeliveryTimeInDays: 2,
                maximumDeliveryTimeInDays: 3,
                shippingAmmout: "112",
              },
            }}
          >
            <WishlistProvider>
               <Component {...pageProps} />
            </WishlistProvider>
          </CheckoutProvider>
        </CartProvider>
      </AirsokoReactProvider>
    </>
  );
}

🀝 Contributing

Contributions to improve this package are welcome. Please adhere to the project's coding standards and commit guidelines.

License

MIT License

βš’οΈ Built With

  • @types/node

  • typescript


    🌟 This README was generated with πŸ’– by Airsoko

Readme

Keywords

none

Package Sidebar

Install

npm i @airsoko/react

Weekly Downloads

2

Version

0.0.4

License

UNLICENSED

Unpacked Size

382 kB

Total Files

155

Last publish

Collaborators

  • cluewax