1.2.3 • Published 9 months ago

@autoenhance.ai/javascript v1.2.3

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

@autoenhance.ai/javascript

👋 Navigation

✨ Description

Our SDK will help you easily integrate Autoenhance.ai into your codebase in a matter of minutes. We've prepared methods for interacting with our API in all possible ways you might need.

⚠️ Requirements

  • Basic Javascript knowledge and a project set up
  • Autoenhance.ai API key Don't have an API key ? Sign up in our Webapp, and you will find it on the API page!

🔧 Installation

Install Autoenhance.ai SDK with a simple CLI command

With npm:

npm install @autoenhance.ai/javascript

With yarn:

yarn add @autoenhance.ai/javascript

⚙️ Configuration

Follow these simple steps in order to implement and configure our SDK

Import Autoenhance SDK package:

import Autoenhance from '@autoenhance.ai/javascript';

Create a constant, and add your API key

const autoenhance = new Autoenhance('YOUR API KEY');

Boom, that's it! Now you can interact with our API in a matter of seconds.

💎 Examples

Uploading image

  const uploadImage = async (imageProperties: ImageIn, image: Blob) => {
    const { s3PutObjectUrl } = await autoenhance.ImagesApi.createImage({
      imageIn: {
        ...imageProperties
      }
    })

    await fetch(s3PutObjectUrl, {
      method: "PUT",
        headers: {
            "Content-Type": "image/jpeg",
        },
        body: image,
    });
    
  }

Retrieving order

  const getOrder = async (orderId:string) => {
    const order = await autoenhance.OrdersApi.retreiveOrder({ id: orderId});
  };

Retrieving list of orders

  const getOrders = async () => {
    const response = await autoenhance.OrdersApi.listOrders();
    const orders = response.orders;
  };

Downloading enhanced image

  const downloadImage = async (imageId) => {
    const imageUrl =
      await autoenhance.ImagesApi.downloadEnhancedImageRaw({
          id: imageId,
          size: "large",
      }).then((res) => res.raw.url);
      
    return { url: imageUrl };
  };
1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.4

9 months ago

1.1.2

9 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

12 months ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago