Sh Frontend!
Documentation
Backend Docs
Github
Documentation
Backend Docs
Github
  • Guide

    • Introduction
  • Layouts

    • sh card layout
  • Components

    • ShModal
    • Sh modal Form
    • Sh Canvas
    • Confirmation Action
    • Routes
    • Sh Tabs
    • Sh Dynamic Tabs
    • Sh Form
    • Sh Table
  • Helpers

    • Helpers
    • shUser
    • shApi
    • shRepo
  • About

    • Overview
    • Team

shApi

This is used to make api requests to the backend using axios

Importing

import { shApis } from '@iankibetsh/shframework'

Methods

doGet

Makes a GET request to the backend api

shApis.doGet('users', { role: 'admin' }).then(res => {
    users.value = res.data
  })

Params

endpoint
  • Type: string

  • Required: true

  • Example: users

  • Details:

    This is the backend enpoint for the GET request

data
  • Type: object
  • Required: false
  • Example
{ role: 'admin' }
  • Details

    This will be the request parameters on the GET request

doPost

Makes a POST request to the backend api

shApis.doPost('users/add', { 
  name: 'John', 
  email: 'john@example.com',
  age: 12
}
).then(res => {
    users.value = res.data
  })

Params

endpoint
  • Type: string

  • Required: true

  • Example: users/add

  • Details:

    This is the backend enpoint to post the POST request

data
  • Type: object
  • Required: false
  • Example
{
  name: 'John',
  email: 'john@example.com',
  age: 12
}
  • Details

    This will be post data to the backend endpoint

Last Updated:: 6/27/25, 8:57 AM
Contributors: Hosea Kibet
Prev
shUser
Next
shRepo