JSPM

@realengineai/client

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q26932F
  • License MIT

A simple and easy to use client for the RealEngine.ai API

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@realengineai/client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    RealEngine.ai SDK for JavaScript

    A simple and easy to use client for the RealEngine.ai API

    Installation

    npm install @realengineai/client

    Usage

    Import and initialize a client using an API token from the RealEngine AI Dashboard.

    const { Client } = require("@realengineai/client")
    
    // Initializing a client
    const realEngineAIClient = new RealEngineAIClient({
      auth: process.env.REAL_ENGINE_AI_TOKEN,
    })

    Make a request to get captions for an image.

    const caption = await client.getCaption("http://link.to/image.jpg")

    Handling errors

    If the API returns an unsuccessful response, the returned Promise rejects with a RealEngineAIError.

    The error contains a unique error ID that can be used by RealEngine AI support team.

    Requirements

    This package supports the following minimum versions:

    • Runtime: node >= 18
    • Type definitions (optional): typescript >= 4.5

    Contributing

    Contributions are welcome!

    License

    This project is licensed under the terms of the MIT license. See the License file for details.