{metadata.description}
} ); } ``` The API is free to use and rate limited per IP address. For the full response contract, see [Metadata API reference](/docs/reference/metadata-response). --- --- title: "Use LinkMetadata with Vue" description: "Add the preview component to Vue or fetch metadata for a custom Vue card." navTitle: "Vue" category: "how-to" date: "2026-06-20" tags: ["how-to","vue","component"] published: true --- Vue can render the LinkMetadata web component directly, or you can call the API with `fetch` and build your own card. ## Configure the custom element If you use Vue with Vite, tell Vue that `link-metadata-preview` is a browser custom element: ```ts // vite.config.ts import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; export default defineConfig({ plugins: [ vue({ template: { compilerOptions: { isCustomElement: (tag) => tag === "link-metadata-preview" } } }) ] }); ``` Load the component script once in `index.html`: ```html ``` Then use it in a Vue template: ```vue{{ metadata.description }}
{{ url }} Loading preview... ``` The API is free to use and rate limited per IP address. For image proxy behavior, see [Images and CORS](/docs/explanation/images-and-cors). --- --- title: "Use LinkMetadata with Svelte" description: "Add the preview component to Svelte or fetch metadata for a custom Svelte card." navTitle: "Svelte" category: "how-to" date: "2026-06-20" tags: ["how-to","svelte","component"] published: true --- Svelte can render the LinkMetadata custom element directly. Use the API directly when you want your own markup. ## Use the preview component Load the component in `app.html`, a layout, or the page head: ```svelte{metadata.description}
{/if} {:else if error} {url} {:else} Loading preview... {/if} ``` In SvelteKit, move the same `fetch` call into a `load` function when you want metadata before the page renders. The API is free to use and rate limited per IP address. For complete field details, see [Metadata API reference](/docs/reference/metadata-response). --- --- title: "Use LinkMetadata with Astro" description: "Add the preview component to Astro or fetch metadata during Astro rendering." navTitle: "Astro" category: "how-to" date: "2026-06-20" tags: ["how-to","astro","component"] published: true --- Astro works well with LinkMetadata because you can either render the hosted web component or fetch metadata while Astro renders the page. ## Use the preview component Load the component script and add the custom element in any `.astro` page or layout: ```astro --- const url = "https://example.com/article"; ---{metadata.description}
} ) : ( {url} )} ``` The API is free to use and rate limited per IP address. For caching and error details, see [Metadata API reference](/docs/reference/metadata-response). --- --- title: "Component reference" description: "Attributes, CSS variables, and stable selectors for the preview component." navTitle: "Component" category: "reference" date: "2026-06-20" tags: ["reference","component"] published: true --- Load the component once, then use `
```
## Proxy responses
Successful proxy responses include:
```http
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=86400
Content-Type: image/png
```
Common error cases include:
| Status | Reason |
| ------ | ------ |
| `400` | Missing URL, invalid URL, unsupported protocol, non-image content, empty response, or unsupported image bytes. |
| Upstream status | The remote image request failed, for example `404` or `403`. |
## When to use each option
| Situation | Recommended approach |
| --------- | -------------------- |
| You use `