Ablo Typescript SDK
This is the official Ablo Typescript SDK.
Installation
npm install ablo-ts-sdk
Usage
To use the Ablo Typescript SDK, you need to initialize it with your API key. Here's a basic example of how to use the SDK:
import { Ablo } from 'ablo-ts-sdk'
const ablo = new Ablo('your-api-key')
const styles = await ablo.styles.getAll()
console.log('Styles:', styles)
const backgroundRemovalResult = await ablo.backgroundRemoval.byUrl(
imageUrl: 'https://example.com/image.jpg',
)
console.log('Background removed image:', backgroundRemovalResult.image)
const fontMakerResult = await ablo.fontMaker.run({
text: 'Hello World',
styleId: 'some-fontmaker-style-id',
})
console.log('FontMaker generated images:', fontMakerResult.images)
const imageMakerResult = await ablo.imageMaker.run({
freeText: 'A beautiful sunset over the ocean',
styleId: 'some-imagemaker-style-id',
})
console.log('Image Maker generated images:', imageMakerResult.images)
const photoTransformerResult = await ablo.photoTransformer.fromUrl({
imageUrl: 'https://example.com/image.jpg',
styleId: 'some-phototransformer-style-id',
})
console.log('Photo Transformer result:', photoTransformerResult.images)