Packages
api
Reference

API Reference

Functions

1. getErrorMessage

This function is used for handling form error messages.

import { getErrorMessage } from "@airsoko/api";
 
const errorMessage = getErrorMessage(/* arguments */);
console.log(errorMessage);

2. generateRandomString

This function is used for generating random strings.

import { generateRandomString } from "@airsoko/api";
 
const randomString = generateRandomString(/* arguments */);
console.log(randomString);

3. getCookie

This function is used for retrieving cookies.

import { getCookie } from "@airsoko/api";
 
const cookieValue = getCookie(/* arguments */);
console.log(cookieValue);

4. getShopJwtToken

This function is specifically designed for retrieving JWT tokens related to a shop.

import { getShopJwtToken } from "@airsoko/api";
 
const jwtToken = getShopJwtToken(/* arguments */);
console.log(jwtToken);

5. getMainDomain

This function is used for obtaining the main domain from a URL.

import { getMainDomain } from "@airsoko/api";
 
const mainDomain = getMainDomain(/* arguments */);
console.log(mainDomain);

6. maciveApiHeaders

This function provides headers for Macive API requests.

import { maciveApiHeaders } from "@airsoko/api";
 
const headers = maciveApiHeaders(/* arguments */);
console.log(headers);

7. removeCookie

This function is used for removing cookies.

import { removeCookie } from "@airsoko/api";
 
removeCookie(/* arguments */);

8. setCookie

This function is is used for setting cookies.

import { setCookie } from "@airsoko/api";
 
setCookie(/* arguments */);

9. getURL

These functions are used for retrieving the full URL

const fullURL = getURL(/* arguments */);
 
console.log(fullURL);

9. getProtocol

These functions are used for retrieving the protocol .

import { getProtocol, getURL } from "@airsoko/api";
 
const protocol = getProtocol(/* arguments */);
console.log(protocol);

🤝 Contributing

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

License

MIT License