How-to Guides
Link Preview
Extract and preview links from message text.
Link Preview
Extract and preview links from message text.
import { createLinkPreview, linkPreviewFromData } from "@fluxy-chat/sdk";Extracting Links
const api = createLinkPreview();
const links = api.extractLinks("Check https://example.com and http://test.com/page");
// -> ["https://example.com", "http://test.com/page"]Fetching Preview Data
const preview = await api.fetchMessage("https://example.com");
// -> { url: "https://example.com", title: "example.com" }Results are cached in memory for the lifetime of the API instance.
Manual Creation
const preview = linkPreviewFromData({
url: "https://example.com",
title: "Example",
description: "An example site",
imageUrl: "https://example.com/og.png",
});Types
LinkPreviewData:\{ url, title?, description?, imageUrl?, favicon?, siteName? \}LinkPreviewApi:\{ fetchMessage(url), extractLinks(text) \}
Lifecycle Callbacks
Lifecycle callbacks let you run custom code at key points during `runAgentLoop`. Use them for logging, analytics, monitoring, metrics, or any application-specif
Language Model Middleware
Language model middleware intercepts and modifies LLM calls — enabling guardrails, caching, RAG injection, logging, and parameter transformation in a model-agno