You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f5c18bd
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(astro-sdk): tighten config resolution, types, helpers; drop PUBLIC_ env
Centralize ImageKit config resolution, harden the image service, and
simplify the OG helper. Also remove PUBLIC_IMAGEKIT_URL_ENDPOINT since
every SDK caller runs server-side.
Resolution & integration:
- getImageKitConfig is the single resolver: prop > integration config
(virtual:@imagekit/astro/config) > IMAGEKIT_URL_ENDPOINT
- Video.astro delegates to getImageKitConfig instead of resolving inline
- Integration only carries forward known service config keys
(urlEndpoint, transformationPosition); foreign keys from a previous
service no longer leak through
- Warn when urlEndpoint cannot be parsed as a URL
- Mark virtual:@imagekit/astro/config external in tsup
Image service:
- Throw a clear error when no urlEndpoint can be resolved (was: silent '')
- Add IKImageTransform type, remove all `as any` casts
- Align quality presets with Astro sharp defaults (low/mid/high/max
= 25/50/75/100, was 30/80/90/95)
Helpers & types:
- Drop `format` option from getOgImageTags; emit a single image URL for
og:image and twitter:image (ImageKit auto-format negotiates
WebP/AVIF/JPEG via the Accept header)
- VideoProps extends Astro's HTMLAttributes<'video'> for full HTML
video attribute autocomplete (replaces [key: string]: unknown)
test-app:
- Add /og page exercising getOgImageTags (default, minimal, custom
dimensions + transformation)
- Link /og from index page
* If omitted, PUBLIC_IMAGEKIT_URL_ENDPOINT is checked first,
42
-
* then IMAGEKIT_URL_ENDPOINT.
41
+
* If omitted, IMAGEKIT_URL_ENDPOINT is used.
43
42
*/
44
43
urlEndpoint?: string;
45
44
@@ -197,7 +196,6 @@ export default function imagekit(
197
196
constresolvedUrlEndpoint=
198
197
options.urlEndpoint??
199
198
asString(existingServiceConfig.urlEndpoint)??
200
-
import.meta.env?.PUBLIC_IMAGEKIT_URL_ENDPOINT??
201
199
import.meta.env?.IMAGEKIT_URL_ENDPOINT;
202
200
203
201
constresolvedTransformationPosition=
@@ -211,6 +209,12 @@ export default function imagekit(
211
209
? parseEndpoint(resolvedUrlEndpoint)
212
210
: undefined;
213
211
212
+
if(resolvedUrlEndpoint&&!endpoint){
213
+
logger.warn(
214
+
`Could not parse urlEndpoint "${resolvedUrlEndpoint}" as a URL. Make sure it includes the protocol (e.g. "https://ik.imagekit.io/your_id"). The endpoint host will not be added to image.domains/remotePatterns.`,
'An ImageKit URL endpoint is required. Set PUBLIC_IMAGEKIT_URL_ENDPOINT or IMAGEKIT_URL_ENDPOINT in your environment, or pass urlEndpoint as a prop.'
45
+
'An ImageKit URL endpoint is required. Pass urlEndpoint to the imagekit() integration in astro.config.mjs, set IMAGEKIT_URL_ENDPOINT, or pass urlEndpoint as a prop.'
'[@imagekit/astro] An ImageKit URL endpoint is required. Pass urlEndpoint to the imagekit() integration in astro.config.mjs, set IMAGEKIT_URL_ENDPOINT, or pass urlEndpoint as a prop on <Image>.',
0 commit comments