Skip to content

Commit 21caa93

Browse files
committed
fix(docs): add missing commas in URL generation examples for clarity
1 parent 7a2bc8f commit 21caa93

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const client = new ImageKit({
108108
// Basic URL without transformations
109109
const url = client.helper.buildSrc({
110110
urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',
111-
src: '/path/to/image.jpg'
111+
src: '/path/to/image.jpg',
112112
});
113113
// Result: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg
114114
```
@@ -128,9 +128,9 @@ const transformedUrl = client.helper.buildSrc({
128128
height: 300,
129129
crop: 'maintain_ratio',
130130
quality: 80,
131-
format: 'webp'
132-
}
133-
]
131+
format: 'webp',
132+
},
133+
],
134134
});
135135
// Result: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg?tr=w-400,h-300,c-maintain_ratio,q-80,f-webp
136136
```
@@ -153,17 +153,17 @@ const imageOverlayUrl = client.helper.buildSrc({
153153
input: '/path/to/overlay-logo.png',
154154
position: {
155155
x: 10,
156-
y: 10
156+
y: 10,
157157
},
158158
transformation: [
159159
{
160160
width: 100,
161-
height: 50
162-
}
163-
]
164-
}
165-
}
166-
]
161+
height: 50,
162+
},
163+
],
164+
},
165+
},
166+
],
167167
});
168168
// Result: URL with image overlay positioned at x:10, y:10
169169
```
@@ -187,19 +187,19 @@ const textOverlayUrl = client.helper.buildSrc({
187187
position: {
188188
x: 50,
189189
y: 50,
190-
focus: 'center'
190+
focus: 'center',
191191
},
192192
transformation: [
193193
{
194194
fontSize: 40,
195195
fontFamily: 'Arial',
196196
fontColor: 'FFFFFF',
197-
typography: 'b' // bold
198-
}
199-
]
200-
}
201-
}
202-
]
197+
typography: 'b', // bold
198+
},
199+
],
200+
},
201+
},
202+
],
203203
});
204204
// Result: URL with bold white Arial text overlay at center position
205205
```
@@ -221,18 +221,18 @@ const multipleOverlaysUrl = client.helper.buildSrc({
221221
type: 'text',
222222
text: 'Header Text',
223223
position: { x: 20, y: 20 },
224-
transformation: [{ fontSize: 30, fontColor: '000000' }]
225-
}
224+
transformation: [{ fontSize: 30, fontColor: '000000' }],
225+
},
226226
},
227227
{
228228
overlay: {
229229
type: 'image',
230230
input: '/watermark.png',
231231
position: { focus: 'bottom_right' },
232-
transformation: [{ width: 100, opacity: 70 }]
233-
}
234-
}
235-
]
232+
transformation: [{ width: 100, opacity: 70 }],
233+
},
234+
},
235+
],
236236
});
237237
// Result: URL with text overlay at top-left and semi-transparent watermark at bottom-right
238238
```
@@ -250,19 +250,19 @@ const signedUrl = client.helper.buildSrc({
250250
{
251251
width: 400,
252252
height: 300,
253-
quality: 90
254-
}
253+
quality: 90,
254+
},
255255
],
256256
signed: true,
257-
expiresIn: 3600 // URL expires in 1 hour
257+
expiresIn: 3600, // URL expires in 1 hour
258258
});
259259
// Result: URL with signature parameters (?ik-t=timestamp&ik-s=signature)
260260

261261
// Generate a signed URL that doesn't expire
262262
const permanentSignedUrl = client.helper.buildSrc({
263263
urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',
264264
src: '/private/secure-image.jpg',
265-
signed: true
265+
signed: true,
266266
// No expiresIn means the URL won't expire
267267
});
268268
// Result: URL with signature parameter (?ik-s=signature)

0 commit comments

Comments
 (0)