Skip to content

Commit 7b72059

Browse files
authored
Merge pull request #2 from Frontify/dynamic-preview-url-on-asset
feat: Add dynamic preview url to asset query
2 parents efe5ed9 + 20ec62c commit 7b72059

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
/dist
2+
/dist
3+
.idea/

src/Api.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export type FrontifyAsset = {
7575
size: number;
7676
downloadUrl?: string;
7777
previewUrl?: string;
78+
dynamicPreviewUrl?: string;
7879
icon?: string;
7980
focalPoint?: number[];
8081
width?: number;
@@ -134,6 +135,7 @@ fragment onImage on Image {
134135
size
135136
downloadUrl(permanent: $permanent)
136137
previewUrl
138+
dynamicPreviewUrl
137139
width
138140
height
139141
focalPoint
@@ -146,6 +148,7 @@ fragment onFile on File {
146148
size
147149
downloadUrl(permanent: $permanent)
148150
icon: previewUrl
151+
dynamicPreviewUrl
149152
}
150153
151154
fragment onDocument on Document {
@@ -156,6 +159,7 @@ fragment onDocument on Document {
156159
pageCount
157160
downloadUrl(permanent: $permanent)
158161
previewUrl
162+
dynamicPreviewUrl
159163
focalPoint
160164
}
161165
@@ -166,6 +170,7 @@ fragment onAudio on Audio {
166170
size
167171
downloadUrl(permanent: $permanent)
168172
previewUrl
173+
dynamicPreviewUrl
169174
}
170175
171176
fragment onVideo on Video {
@@ -175,6 +180,7 @@ fragment onVideo on Video {
175180
size
176181
downloadUrl(permanent: $permanent)
177182
previewUrl
183+
dynamicPreviewUrl
178184
width
179185
height
180186
duration
@@ -192,6 +198,7 @@ export async function requestAssetsById(
192198
'content-type': 'application/json',
193199
authorization: `Bearer ${bearerToken}`,
194200
'x-frontify-beta': 'enabled',
201+
'x-frontify-development-flags': 'PUBLIC_API_DYNAMIC_CDN',
195202
},
196203
body: JSON.stringify({
197204
query: ASSET_BY_IDS_QUERY,

0 commit comments

Comments
 (0)