Skip to content

Abloatai/decks

Repository files navigation

@abloatai/decks

Build Ablo slide decks from code — a typed resource API. Each call compiles to the same canonical commit operation the Ablo editor and AI produce, and posts it to the Ablo API with your key. No code sandbox, no server internals — just decks, slides, layers, layouts, themes, and images.

npm i @abloatai/decks
import { Decks, text, table, chart } from '@abloatai/decks';

const ablo = new Decks(process.env.ABLO_API_KEY);

const deck = await ablo.decks.create({
  title: 'Q3 Board Update',
  slides: [
    {
      title: 'Revenue',
      layers: [
        { type: 'text', text: 'Revenue up 40% YoY', style: 'h1', at: { x: 160, y: 120, w: 1600, h: 160 } },
        { type: 'bar', data: [{ label: 'Q1', value: 120 }, { label: 'Q2', value: 168 }], at: { x: 160, y: 340, w: 1600, h: 600 } },
      ],
    },
  ],
});

Get a key from your Ablo workspace (Settings → API) and read the full guide at docs.tryablo.com.

What you get

  • Decks & slides — declarative trees or imperative calls; client-minted ids returned synchronously.
  • Layerstext, bullets, numbered, bar, donut, chart, table, image, shape, icon.
  • Styling — fonts, weights, line-height, letter-spacing, highlight, paragraph spacing; fills (solid / gradient / mesh / shader), shadows, effects.
  • Charts & tables — every chart family; full cell + table styling including border width.
  • Layouts & themes — named placeholders with an AI brief (prompt + examples); structured { fonts, colors } themes.
  • Imagesablo.images.upload({ bytes, contentType }) → hosted URL.
  • PowerPoint importablo.decks.importPptx({ bytes }) rebuilds a .pptx as a real, editable Ablo deck (text, shapes, images, tables, live charts, layout & theme).

Every option is a typed, discoverable Zod enum — you never guess a string.

Import a PowerPoint

import { Decks } from '@abloatai/decks';
import { readFileSync } from 'node:fs';

const ablo = new Decks(process.env.ABLO_API_KEY);

const { deckId, slideCount } = await ablo.decks.importPptx({
  bytes: readFileSync('board-update.pptx'),
});

Runs the same converter the Ablo editor uses, so the result matches an editor import of the same file. Returns { deckId, slideCount, layoutId } — live and editable immediately. See the import guide.

About

Build decks from code

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors