Skip to content
OpenSmartRoute
Skillv1.0.0

adobe-hello-world

Create minimal working examples for Adobe APIs: Firefly image generation, PDF extraction, and Photoshop background removal. Use when starting a new Adobe integration, testing your setup, or learning b

by gabrielmoreira(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from gabrielmoreira/agent-skills-mirror (mirrors/repos/jeremylongshore@tons-of-skills-marketplace/plugins/saas-packs/adobe-pack/skills/adobe-hello-world/SKILL.md). Install upstream with npx skills add gabrielmoreira/agent-skills-mirror --skill adobe-hello-world. Copyright stays with the author (MIT).

Adobe Hello World

Overview

Three minimal working examples covering Adobe's core API surfaces: Firefly AI image generation, PDF content extraction, and Photoshop background removal.

Prerequisites

  • Completed adobe-install-auth setup
  • Valid OAuth Server-to-Server credentials
  • Node.js 18+ with @adobe/firefly-apis or @adobe/pdfservices-node-sdk installed

Instructions

Example 1: Firefly Text-to-Image Generation

// hello-firefly.ts
import 'dotenv/config';
import { getAdobeAccessToken } from './adobe/auth';

async function generateImage() {
  const token = await getAdobeAccessToken();

  const response = await fetch(
    'https://firefly-api.adobe.io/v3/images/generate',
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'x-api-key': process.env.ADOBE_CLIENT_ID!,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        prompt: 'A futuristic cityscape at sunset with flying cars',
        n: 1,              // number of images
        size: {
          width: 1024,
          height: 1024,
        },
        contentClass: 'art', // "art" or "photo"
      }),
    }
  );

  if (!response.ok) {
    throw new Error(`Firefly API error: ${response.status} ${await response.text()}`);
  }

  const result = await response.json();
  console.log('Generated image URL:', result.outputs[0].image.url);
  return result;
}

generateImage().catch(console.error);

Example 2: PDF Text Extraction

// hello-pdf.ts
import {
  ServicePrincipalCredentials,
  PDFServices,
  MimeType,
  ExtractPDFParams,
  ExtractElementType,
  ExtractPDFJob,
  ExtractPDFResult,
} from '@adobe/pdfservices-node-sdk';
import * as fs from 'fs';

async function extractPDF() {
  const credentials = new ServicePrincipalCredentials({
    clientId: process.env.ADOBE_CLIENT_ID!,
    clientSecret: process.env.ADOBE_CLIENT_SECRET!,
  });

  const pdfServices = new PDFServices({ credentials });

  // Upload the PDF
  const inputStream = fs.createReadStream('./sample.pdf');
  const inputAsset = await pdfServices.upload({
    readStream: inputStream,
    mimeType: MimeType.PDF,
  });

  // Configure extraction (text + tables)
  const params = new ExtractPDFParams({
    elementsToExtract: [ExtractElementType.TEXT, ExtractElementType.TABLES],
  });

  // Run extraction job
  const job = new ExtractPDFJob({ inputAsset, params });
  const pollingURL = await pdfServices.submit({ job });
  const result = await pdfServices.getJobResult({
    pollingURL,
    resultType: ExtractPDFResult,
  });

  // Download result ZIP containing structuredData.json
  const resultAsset = result.result!.resource;
  const streamAsset = await pdfServices.getContent({ asset: resultAsset });
  const outputStream = fs.createWriteStream('./extracted-output.zip');
  streamAsset.readStream.pipe(outputStream);

  console.log('Extraction complete: ./extracted-output.zip');
}

extractPDF().catch(console.error);

Example 3: Photoshop Remove Background

// hello-photoshop.ts
import 'dotenv/config';
import { getAdobeAccessToken } from './adobe/auth';

async function removeBackground() {
  const token = await getAdobeAccessToken();

  // Input/output must be pre-signed URLs (S3, Azure Blob, Dropbox)
  const response = await fetch(
    'https://image.adobe.io/sensei/cutout',
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'x-api-key': process.env.ADOBE_CLIENT_ID!,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        input: {
          href: 'https://your-bucket.s3.amazonaws.com/input-photo.jpg',
          storage: 'external',
        },
        output: {
          href: 'https://your-bucket.s3.amazonaws.com/output-cutout.png',
          storage: 'external',
          type: 'image/png',
        },
      }),
    }
  );

  const result = await response.json();
  console.log('Job status URL:', result._links.self.href);

  // Poll for completion
  let status = result;
  while (status.status !== 'succeeded' && status.status !== 'failed') {
    await new Promise(r => setTimeout(r, 2000));
    const poll = await fetch(status._links.self.href, {
      headers: {
        'Authorization': `Bearer ${token}`,
        'x-api-key': process.env.ADOBE_CLIENT_ID!,
      },
    });
    status = await poll.json();
  }

  console.log('Background removal:', status.status);
}

removeBackground().catch(console.error);

Output

  • Generated AI image URL from Firefly API
  • Extracted PDF text/tables in structured JSON format
  • Background-removed PNG from Photoshop API

Error Handling

Error Cause Solution
403 Forbidden Missing API entitlement Enable the API in Developer Console project
400 Bad Request on Firefly Invalid prompt or parameters Check content policy; prompts cannot request trademarks or people
invalid_content_type on PDF Wrong MimeType Ensure input is actually a PDF, not a renamed file
InputValidationError on Photoshop Invalid storage URL Use pre-signed URLs with read/write permissions
429 Too Many Requests Rate limit exceeded Implement backoff; see adobe-rate-limits

Examples

Start with the smallest applicable command or code example already provided in this guide, using a non-production Adobe environment and credentials. Confirm the documented response or validation result before applying the pattern to production.

Resources

Next Steps

Proceed to adobe-local-dev-loop for development workflow setup.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/gabrielmoreira-agent-skills-mirror-adobe-hello-world/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

gabrielmoreira-agent-skills-mirror-adobe-hello-world.ocm.jsonjson
{
  "ocm": "1",
  "id": "gabrielmoreira-agent-skills-mirror-adobe-hello-world",
  "kind": "skill",
  "name": "adobe-hello-world",
  "description": "Create minimal working examples for Adobe APIs: Firefly image generation, PDF extraction, and Photoshop background removal. Use when starting a new Adobe integration, testing your setup, or learning basic Adobe API patterns. Trigger with phrases like \"adobe hello world\", \"adobe example\", \"adobe quick start\", \"simple adobe code\", \"first adobe API call\".",
  "publisher": "gabrielmoreira",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "general_chat"
    ],
    "tags": [
      "skill-md",
      "saas",
      "design",
      "adobe",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Create minimal working examples for Adobe APIs: Firefly image generation, PDF extraction, and Photoshop background removal. Use when starting a new Adobe integration, testing your setup, or learning basic Adobe API patterns. Trigger with phrases like \"adobe hello world\", \"adobe example\", \"adobe quick start\", \"simple adobe code\", \"first adobe API call\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/gabrielmoreira/agent-skills-mirror",
      "path": "mirrors/repos/jeremylongshore@tons-of-skills-marketplace/plugins/saas-packs/adobe-pack/skills/adobe-hello-world/SKILL.md",
      "ref": "d5c793801e2fc9c29aa3531805809b3460b19d09",
      "url": "https://github.com/gabrielmoreira/agent-skills-mirror/blob/d5c793801e2fc9c29aa3531805809b3460b19d09/mirrors/repos/jeremylongshore@tons-of-skills-marketplace/plugins/saas-packs/adobe-pack/skills/adobe-hello-world/SKILL.md",
      "key": "gabrielmoreira/agent-skills-mirror/mirrors/repos/jeremylongshore@tons-of-skills-marketplace/plugins/saas-packs/adobe-pack/skills/adobe-hello-world/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit"
    ],
    "license": "MIT"
  },
  "instructions": "# Adobe Hello World\n\n## Overview\n\nThree minimal working examples covering Adobe's core API surfaces: Firefly AI image generation, PDF content extraction, and Photoshop background removal.\n\n## Prerequisites\n\n- Completed `adobe-install-auth` setup\n- Valid OAuth Server-to-Server credentials\n- Node.js 18+ with `@adobe/firefly-apis` or `@adobe/pdfservices-node-sdk` installed\n\n## Instructions\n\n### Example 1: Firefly Text-to-Image Generation\n\n```typescript\n// hello-firefly.ts\nimport 'dotenv/config';\nimport { getAdobeAccessToken } from './adobe/auth';\n\nasync function generateImage() {\n  const token = ",
  "cost": {
    "context_tokens": 1476
  }
}

Fetch it by URL: GET /api/v1/registry/gabrielmoreira-agent-skills-mirror-adobe-hello-world/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.