@autoenhance.ai/javascript
TypeScript icon, indicating that this package has built-in type declarations

1.2.22 • Public • Published

@autoenhance.ai/javascript

Autoenhance.ai logo

Autoenhance.ai Javascript SDK

The AI photo editor that enhances your workflow now available with easy and quick Javascript SDK including Typescript support!

👋 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.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.retrieveOrder({ id: orderId});
  };

Retrieving list of orders

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

Downloading enhanced image

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

Readme

Keywords

none

Package Sidebar

Install

npm i @autoenhance.ai/javascript

Weekly Downloads

5

Version

1.2.22

License

ISC

Unpacked Size

2.02 MB

Total Files

100

Last publish

Collaborators

  • jbednar97
  • james_autoenhance