1.0.20 • Published 7 months ago

bubblefetcher v1.0.20

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

BubbleFetcher · MIT License PRs Welcome

BubbleFetcher is a library designed to simplify communication with Bubble.io, a no-code tool.

With BubbleFetcher, developers can easily integrate Bubble applications with their own stack and accelerate the development process.

BubbleFetcher provides a wrapper over the Bubble API, providing easy-to-use methods for common tasks such as CRUD operations, authentication, and accessing data.

Installation

Install bubbleFetcher with NPM or Yarn

  npm i bubblefetcher
  
  or

  yarn add bubblefetcher

How to Use ?

  1. Import bubbleFetcher
import { bubbleFetcher } from "bubblefetcher";
  1. Configure variables
bubbleFetcher.init({
  apiKey : "your-bubble-api-key",
  domain : "your-bubble-domain",
  isDev : true || false
})

Example

const BUBBLE_API_KEY = process.env.BUBBLE_API_KEY
bubbleFetcher.init({
  apiKey : BUBBLE_API_KEY,
  domain : "edu.todomall.kr",
  isDev : process.env.NODE_ENV === "development"
})
  1. Request

  • bubbleFetcher.get(objectName[, sortOption, constrains])

        // getAll
        const users = await bubbleFetcher.get("/user")
    
        // getAllWithSort
        const users = await bubbleFetcher.get("/user", {
          sortOption: {
            sort_field: "name_text",
            descending: true || false,
          },
        });
    
        // getAllWithConstarint
        const users = await bubbleFetcher.get("/user", {
          constraints: {
            key: "name_text",
            constraint_type: "equals",
            value: "target value",
          },
        });
    
        // getAllWithPage
        const users = await bubbleFetcher.get("/user", {
            pageOption: {
              cursor: 0,
              limit: 10,
            },   
        })
    // get with Sort and Constarint and Page
    const users = await bubbleFetcher.get("/user", {
     sortOption: {
       sort_field: "name_text",
       descending: true || false, 
     },
     constraints: {
       key: "name_text",
       constraint_type: "equals",
       value: "target value",
     },
     pageOption: {
       cursor: 0,
       limit: 10,
     },
   });
```
  • bubbleFetcher.post(objectName, body)

      await bubbleFetcher.post("/user" , {
        body :{
          name_text : "Sangkun-svg",
          age_number: 23
        }
      });
  • bubbleFetcher.put(objectName, body) && bubbleFetcher.patch(objectName, body)

      await bubbleFetcher.put("/user" , {
        body :{
          name_text : "Sangkun-svg",
          age_number: 23
        }
      });
    
      await bubbleFetcher.patch("/user" , {
        body :{
          name_text : "Sangkun-svg",
          age_number: 23
        }
      });
  • bubbleFetcher.delete(objectName)

      await bubbleFetcher.delete("/user/${UID}")

Used By

This project is used by the following companies:

Contributing

Contributions are always welcome!

Reference

1.0.20

7 months ago

1.0.19

8 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.16

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago