@keenpix/sveltekit
v0.3.1
Published
Isomorphic Keenpix image attributes and loaders for SvelteKit.
Maintainers
Readme
@keenpix/sveltekit
Stable SvelteKit adapter built on @keenpix/svelte. It provides SSR-safe image props and a URL loader from one configuration object.
pnpm add @keenpix/sveltekit// src/lib/keenpix.ts
import { createSvelteKitKeenpix } from '@keenpix/sveltekit'
export const keenpix = createSvelteKitKeenpix({
baseUrl: 'https://images.example.com',
projectId: 'website',
})<script lang="ts">
import { keenpix } from '$lib/keenpix'
</script>
<img {...keenpix.imageProps({ alt: 'Hero', src: 'hero.jpg', widths: [640, 1280] })} />The package does not install a SvelteKit hook because image URL generation is pure and isomorphic; this keeps it safe for SSR, prerendering, and client navigation.
