Skip to content

Commit e106c71

Browse files
New Components - alttextlab (#17624)
* new component: alttextlab * new component: alttextlab * eslint updates * version * pnpm-lock.yaml * app slug * pnpm-lock.yaml * pnpm-lock.yaml --------- Co-authored-by: Michelle Bergeron <[email protected]>
1 parent 3452ab6 commit e106c71

File tree

9 files changed

+164
-17
lines changed

9 files changed

+164
-17
lines changed

components/alttextlab/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Overview
2+
3+
AltTextLab's API provides powerful AI-generated alternative text for images - enhancing SEO, accessibility, and automation workflows. With Pipedream, you can create workflows that generate alt text for images automatically, connect it with your CMS or e-commerce platform. Pipedream’s serverless architecture lets you trigger these workflows on events, schedules, or incoming webhooks without maintaining your own infrastructure.
4+
# Example Use Cases
5+
6+
- **Automated SEO Optimization for E-commerce**: Automatically generate alt text for new product images uploaded to a Shopify or WooCommerce store and save the metadata to your CMS or database.
7+
8+
- **Content Publishing Pipelines**: When a new blog post with images is published in your CMS (e.g., Ghost, WordPress, Webflow), send the image URLs to AltTextLab, generate alt text, and attach it back to the post or send it via email for editorial review.
9+
10+
- **Bulk Image Processing for Media Libraries**: Periodically scan a folder in Dropbox, S3, or Google Drive for new images and generate alt text descriptions for accessibility compliance and tagging.
11+
12+
# Getting Started
13+
14+
To get started, first log in to or create your [Pipedream account](https://pipedream.com) and start a new workflow.
15+
16+
Go to [AltTextLab](https://www.alttextlab.com/) and create an account (or log in if you already have one). Then, in the Dashboard, navigate to the API Keys section, generate a new API key, and copy it — you’ll use this key to authenticate your requests.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import altTextLab from "../../alttextlab.app.mjs";
2+
import { AI_WRITING_STYLE } from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "alttextlab-generate-alt-text",
6+
name: "Generate Alt Text",
7+
description: "Generates alt text for images using AI. [See the documentation](https://www.alttextlab.com/docs/api)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
altTextLab,
12+
alert: {
13+
type: "alert",
14+
alertType: "info",
15+
content: "Supported formats: PNG, JPG, WebP, AVIF, SVG",
16+
},
17+
imageUrl: {
18+
type: "string",
19+
label: "Image URL",
20+
description: "Provide the direct URL to the image you want to generate alt text for. Make sure the link is publicly accessible (not behind a login or firewall).",
21+
},
22+
lang: {
23+
type: "string",
24+
label: "Language",
25+
description: "Enter the language code for the alt text generation (e.g., \"en\" for English, \"fr\" for French). See the [full list of supported languages](https://www.alttextlab.com/docs/api#language)",
26+
default: "en",
27+
},
28+
style: {
29+
type: "string",
30+
label: "AI writing styles",
31+
options: AI_WRITING_STYLE,
32+
description: "Alt-text writing styles define the tone, structure, and level of detail used to describe an image. [Learn more](https://www.alttextlab.com/docs/writing-style)",
33+
default: "neutral",
34+
},
35+
keywords: {
36+
type: "string[]",
37+
label: "Keywords",
38+
description: "Enter one or more keywords to alt text generation. Separate multiple keywords with commas. Example: cat, window, sunset.",
39+
optional: true,
40+
},
41+
ecommerceProduct: {
42+
type: "string",
43+
label: "Ecommerce Product Name",
44+
description: "The name of the product.",
45+
optional: true,
46+
},
47+
ecommerceBrand: {
48+
type: "string",
49+
label: "Ecommerce Product Brand",
50+
description: "The brand of the product.",
51+
optional: true,
52+
},
53+
ecommerceColor: {
54+
type: "string",
55+
label: "Ecommerce Product Color",
56+
description: "The color of the product.",
57+
optional: true,
58+
},
59+
ecommerceMaterial: {
60+
type: "string",
61+
label: "Ecommerce Product Material",
62+
description: "The material of the product.",
63+
optional: true,
64+
},
65+
},
66+
async run({ $ }) {
67+
const response = await this.altTextLab.altTextGeneration({
68+
$,
69+
data: {
70+
source: "pipedream",
71+
imageUrl: this.imageUrl,
72+
lang: this.lang,
73+
style: this.style,
74+
keywords: this.keywords,
75+
ecommerce: {
76+
product: this.ecommerceProduct,
77+
brand: this.ecommerceBrand,
78+
color: this.ecommerceColor,
79+
material: this.ecommerceMaterial,
80+
},
81+
},
82+
});
83+
84+
$.export("$summary", "Alt text has been generated");
85+
return response;
86+
},
87+
};
Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "alttextlab",
46
propDefinitions: {},
57
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
8+
_baseUrl() {
9+
return "https://app.alttextlab.com/api/v1";
10+
},
11+
_headers(headers) {
12+
return {
13+
...headers,
14+
"x-api-key": `${this.$auth.api_key}`,
15+
};
16+
},
17+
async _makeRequest({
18+
$ = this, path, headers, ...otherOptions
19+
}) {
20+
return axios($, {
21+
url: this._baseUrl() + path,
22+
headers: this._headers(headers),
23+
...otherOptions,
24+
});
25+
},
26+
async altTextGeneration(args) {
27+
return this._makeRequest({
28+
path: "/alt-text/generate",
29+
method: "POST",
30+
...args,
31+
});
932
},
1033
},
11-
};
34+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const AI_WRITING_STYLE = [
2+
{
3+
label: "Descriptive",
4+
value: "descriptive",
5+
},
6+
{
7+
label: "Neutral",
8+
value: "neutral",
9+
},
10+
{
11+
label: "Matter of fact",
12+
value: "matter-of-fact",
13+
},
14+
{
15+
label: "Minimal",
16+
value: "minimal",
17+
},
18+
];

components/alttextlab/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@pipedream/alttextlab",
3-
"version": "0.0.1",
2+
"name": "@pipedream/alttextify",
3+
"version": "0.1.0",
44
"description": "Pipedream AltTextLab Components",
55
"main": "alttextlab.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
15-
}
18+
}

components/cloudbeds/cloudbeds.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/knocommerce/knocommerce.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/upgrade_chat/upgrade_chat.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)