Because
Node.jsSDK

Image spans

Attach images to spans, rendered inline in the dashboard.

Use type: 'image' to attach an image to a span. The dashboard renders the image inline if the URL loads successfully, and falls back to a clickable link if it does not.

Basic usage

because.addSpan('image', 'Generated image', {
  output: { url: 'https://...', label: 'Profile photo' },
  durationMs: 1200
});

Input and output

Both input and output accept an image. Use whichever makes sense for your step: input for an image passed into a processing step, output for a generated result.

because.addSpan('image', 'Resize image', {
  input: { url: 'https://.../original.png', label: 'Original' },
  output: { url: 'https://.../resized.png', label: 'Resized 400×300' },
  durationMs: 85
});

Fields

FieldTypeDescription
urlstringImage URL. Must be a valid URL.
labelstringOptional label shown above the image.

Types

import type { ImageSpanData } from '@refactorlabs/because';
type ImageSpanData = {
  url: string;
  label?: string;
};

On this page