@spreeai/web-sdk
v1.0.0
Published
The SpreeAI Web SDK is a JavaScript library that simplifies the integration of SpreeAI services into web applications. It provides tools to interact with SpreeAI APIs efficiently.
Readme
SpreeAI Web SDK
The SpreeAI Web SDK is a JavaScript library that simplifies the integration of SpreeAI services into web applications. It provides tools to interact with SpreeAI APIs efficiently.
Installation
Install the package using npm or yarn:
npm install @spreeai/web-sdk
# or
yarn add @spreeai/web-sdkInclude the package as a script:
<script type="module" src="https://unpkg.com/@spreeai/web-sdk@latest"></script>
<link
rel="stylesheet"
href="https://unpkg.com/@spreeai/web-sdk@latest/build/dist/web-sdk.css"
/>Usage
Add an element in the location you want to mount the button
Give the button an id as a way to identify it
<div id="try-on-buttton"></div>Importing the SDK
import { tryOnButton } from "spreeai-web-sdk";Initializing the SDK
const spreeAI = new tryOnButton({
elementId: "try-on-buttton",
garmentId: "id of garment",
partnerId: "your partner id",
});Features
- Streamlined API Integration: Simplifies communication with SpreeAI APIs.
- Configurable Options: Customize base URLs, API keys, and other settings.
- Robust Error Handling: Provides built-in error handling for API requests.
API Reference
SpreeAI(options)
- Parameters:
options.elementId(string): The id of the element you want to mount your try on button to.options.garmentId(string): The id of the garment.options.partnerId(string): Your partner id.options.className(string): The id of the garment.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
For questions or support, contact [email protected].
