0.1.8 • Published 2 years ago

@codesdowork/strapi_client v0.1.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Strapi Client

A simple strapi client for your web application.

1. Installation

npm i @codesdowork/strapi_client

2. Usage

Import the client and use your custom types the following way:

import StrapiClient from "@codesdowork/strapi_client";

type StrapiTypes = {
    user: {
        get: User;
        send: SendUserForm;
    };
    restaurants: {
        get: Restaurant;
        send: SendRestaurantForm;
    };
    todos: Todo;
}

const strapi = new StrapiClient<StrapiTypes>("http://localhost:1337")

You can add types for any collection and additionally for user and strapiFile. You can either add types for responses (get) and requests (send) or combine them directly as made for todos in the example above.

You can generate the types using the strapi_tools cli.

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago