Skip to content

nota/n8n-nodes-gyazo

Repository files navigation

n8n Nodes - Gyazo integration

This is an n8n community node that integrates Gyazo with your n8n workflows, so you can run Gyazo operations, manage images, and automate image sharing tasks.

Gyazo serves an API platform for developers to capture, share, and manage screenshots and images, while n8n is a fair-code licensed tool for AI workflow automation that allows you to connect various services.

Table of contents

Installation (self-hosted)

For self-hosted n8n instances, you can install this community node by following these steps:

  1. Go to Settings > Community Nodes in your n8n instance
  2. Select Install
  3. Enter @notainc/n8n-nodes-gyazo in the npm Package Name field
  4. Agree to the risks of using community nodes: select I understand the risks of installing unverified code from a public source
  5. Select Install

After installation restart n8n to register the community node.

Installation on n8n cloud

For n8n cloud users:

  1. Go to Settings > Community Nodes in your n8n cloud instance
  2. Select Install
  3. Enter @notainc/n8n-nodes-gyazo in the npm Package Name field
  4. Select Install

n8n cloud will automatically restart and register the community node.

Installation for development and contributing

To install this node for development:

  1. Clone this repository:

    git clone https://github.com/nota/n8n-nodes-gyazo.git
    cd n8n-nodes-gyazo
  2. Install dependencies:

    npm install
  3. Build the node:

    npm run build
  4. Link the node locally:

    npm link
  5. Install the node into your local n8n instance:

    # In your n8n custom nodes directory (usually ~/.n8n/custom/)
    npm link @notainc/n8n-nodes-gyazo
  6. Start n8n:

    n8n start

Operations

The Gyazo node supports the Image resource.

Image Operations

List

Get a list of user's saved images with pagination support.

Parameters:

  • Page (optional): Page number for pagination (default: 1)
  • Per Page (optional): Number of results per page, max 100 (default: 20)

Example output:

[
	{
		"image_id": "abc123def456789012345678901234ef",
		"permalink_url": "https://gyazo.com/abc123def456789012345678901234ef",
		"thumb_url": "https://thumb.gyazo.com/thumb/200/_abc123def456789012345678901234ef.png",
		"url": "https://i.gyazo.com/abc123def456789012345678901234ef.png",
		"type": "png",
		"created_at": "2024-01-15T10:30:00+0000"
	}
]

Get

Retrieve a specific image by ID or URL.

Parameters:

  • Image: Resource locator supporting:
    • By ID: 32-character hexadecimal string (e.g., abc123def456789012345678901234ef)
    • By URL: Full Gyazo URL (e.g., https://gyazo.com/abc123def456789012345678901234ef)

Example output:

{
	"image_id": "abc123def456789012345678901234ef",
	"type": "png",
	"created_at": "2024-01-15T10:30:00+0000",
	"permalink_url": "https://gyazo.com/abc123def456789012345678901234ef",
	"thumb_url": "https://thumb.gyazo.com/thumb/200/_abc123def456789012345678901234ef.png",
	"url": "https://i.gyazo.com/abc123def456789012345678901234ef.png",
	"metadata": {
		"app": "n8n",
		"title": "Screenshot",
		"desc": "Automated screenshot"
	}
}

Search

Search for images using a query string with pagination support (Pro users only).

Parameters:

  • Query (required): Search query for images
  • Page (optional): Page number for pagination (default: 1)
  • Per Page (optional): Number of results per page, max 100 (default: 20)

Example usage:

  • Query: "workflow diagram"
  • Results: Images matching the search term

Upload

Upload an image to Gyazo.

Parameters:

  • Image Binary (required): Name of the binary property containing image data (default: data)
  • App Name (optional): Application name (default: n8n)
  • Collection ID (optional): Collection ID to add image to
  • Description (optional): Description for the image
  • Referer URL (optional): Referer site URL
  • Title (optional): Title for the image

Example output:

{
	"type": "png",
	"thumb_url": "https://thumb.gyazo.com/thumb/200/_def456abc123789012345678901234ef.png",
	"created_at": "2024-01-15T11:00:00+0000",
	"image_id": "def456abc123789012345678901234ef",
	"permalink_url": "https://gyazo.com/def456abc123789012345678901234ef",
	"url": "https://i.gyazo.com/def456abc123789012345678901234ef.png"
}

Update

Update an existing image's description and alt text.

Parameters:

  • Image: Resource locator supporting:
    • By ID: 32-character hexadecimal string (e.g., abc123def456789012345678901234ef)
    • By URL: Full Gyazo URL (e.g., https://gyazo.com/abc123def456789012345678901234ef)
  • Description (optional): Description for the image
  • Alt Text (optional): Alternative text for the image

Example output:

{
	"image_id": "abc123def456789012345678901234ef",
	"type": "png",
	"created_at": "2024-01-15T10:30:00+0000",
	"permalink_url": "https://gyazo.com/abc123def456789012345678901234ef",
	"thumb_url": "https://thumb.gyazo.com/thumb/200/_abc123def456789012345678901234ef.png",
	"url": "https://i.gyazo.com/abc123def456789012345678901234ef.png",
	"metadata": {
		"app": "n8n",
		"title": "Screenshot",
		"desc": "Updated description",
		"alt_text": "Updated alt text"
	}
}

Credentials

To use this node, you need to configure Gyazo API credentials:

Setting up Gyazo API Access

  1. Create a Gyazo account at gyazo.com if you don't have one
  2. Register an application:
  3. Generate an access token:
    • Use the OAuth flow or generate a personal access token

Configuring credentials in n8n

  1. In your n8n workflow, add the Gyazo node
  2. Click on the credential dropdown and select "Create New"
  3. Choose "Gyazo API" from the credential types
  4. Enter your Access Token in the provided field
  5. Click "Save" to store the credentials

The node will automatically use Bearer token authentication for all API requests.

Compatibility

This node is compatible with:

  • n8n version: 1.0.0 and above
  • Node.js version: 22.0.0 and above

Usage

Basic Image Upload Workflow

  1. Add a trigger node (e.g., Manual Trigger, Webhook)
  2. Add the Gyazo node:
    • Set Resource to "Image"
    • Set Operation to "Upload"
    • Configure the binary property name (default: "data")
  3. Configure credentials with your Gyazo API access token
  4. Execute the workflow

Search and Process Images

  1. Add the Gyazo node:
    • Set Resource to "Image"
    • Set Operation to "Search"
    • Enter your search query
  2. Process results with additional nodes (e.g., filter, transform)
  3. Use image URLs in subsequent workflow steps

Resources

Release

This package follows semantic versioning. Current version: 0.3.0

Publishing to npm

To publish a new version:

  1. Update the version in package.json
  2. Run npm run build to compile the TypeScript
  3. Run npm run lint to ensure code quality
  4. Run npm publish to publish to npm registry

Version History

  • 0.3.0 - Support updating image description and alt text, improved error handling
  • 0.2.0 - Removed support for collection operations, added Pro user restrictions for search
  • 0.1.0 - Initial release with image and collection operations

Troubleshooting

Authentication Issues

Problem: "Unauthorized" or "Invalid access token" errors

Solution:

  • Verify your access token is correct and hasn't expired
  • Ensure your Gyazo application has the necessary scopes

Invalid Resource Format

Problem: "Invalid Image ID format" or "Invalid Gyazo URL format" errors

Solution:

  • Image IDs must be 32-character hexadecimal strings
  • Gyazo URLs must follow the format: https://gyazo.com/{image_id}

Upload Issues

Problem: Image upload fails or returns errors

Solution:

  • Ensure the binary property contains valid image data
  • Check that the binary property name matches the configured parameter
  • Verify the image format is supported by Gyazo (PNG, JPEG, GIF)

Rate Limiting

Problem: "Too Many Requests" errors

Solution:

  • Implement delays between requests using n8n's Wait node
  • Reduce the number of concurrent requests
  • Check Gyazo API rate limits in their documentation

Node Not Appearing

Problem: Gyazo node doesn't appear in n8n after installation

Solution:

  • Restart your n8n instance after installing the community node
  • Check that the installation completed successfully
  • Verify the node appears in Settings > Community Nodes

For additional support, please check the GitHub repository or refer to the Gyazo API documentation.

License

MIT