> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convertly.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Svelte Image CDN SDK

> Generate responsive Convertly Image CDN props in Svelte 4 and Svelte 5 applications.

The Svelte adapter exposes `convertlyImageProps()`, a small helper that returns the attributes a native `<img>` needs.

```bash theme={"system"}
npm install @convertly-sh/image
```

```svelte theme={"system"}
<script lang="ts">
  import { convertlyImageProps } from "@convertly-sh/image/svelte";

  export let path: string;
  export let alt = "";

  $: image = convertlyImageProps({
    namespace: import.meta.env.PUBLIC_CONVERTLY_CDN_NAMESPACE,
    origin: "site",
    src: path,
    width: 1200,
    sizes: "(min-width: 768px) 50vw, 100vw",
  });
</script>

<img {...image} {alt} />
```

For frequently updated image props, create a shared CDN instance with `createConvertlyCdn()` and pass it to the helper as `cdn`.
