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
`urlEndpoint` is required to use the SDK. You can get URL-endpoint from your ImageKit dashboard - https://imagekit.io/dashboard#url-endpoints.
112
-
113
-
`publicKey` and `authenticator` parameters are required if you want to use the SDK for client-side file upload. You can get these parameters from the developer section in your ImageKit dashboard - https://imagekit.io/dashboard#developers.
114
-
115
-
`transformationPosition` is optional. The default value for this parameter is `path`. Acceptable values are `path` & `query`
116
-
117
-
_Note: Do not include your Private Key in any client-side code, including this SDK or its initialization. If you pass the `privateKey` parameter while initializing this SDK, it throws an error_
@@ -279,7 +202,7 @@ _Note: Do not include your Private Key in any client-side code, including this S
279
202
280
203
### Components
281
204
282
-
This SDK provides 4 components, when registered as a plugin:
205
+
This SDK provides 4 components:
283
206
*[`IKContext`](#IKContext) for defining options like `urlEndpoint`, `publicKey` or `authenticator` to all children elements. This component does not render anything.
284
207
*`IKImage` for [image resizing](#image-resizing). This renders a `<img>` tag.
285
208
*`IKVideo` for [video resizing](#video-resizing). This renders a `<video>` tag.
@@ -312,22 +235,6 @@ var imageURL = imagekit.url({
312
235
In order to use the SDK, you need to provide it with a few configuration parameters. You can use a parent `IKContext` component to define common options for all children `IKImage`, `IKVideo` or `IKupload` compoents. For example:
`urlEndpoint` is required to use the SDK. You can get URL-endpoint from your ImageKit dashboard - https://imagekit.io/dashboard#url-endpoints.
254
+
255
+
`publicKey` and `authenticator` parameters are required if you want to use the SDK for client-side file upload. You can get these parameters from the developer section in your ImageKit dashboard - https://imagekit.io/dashboard#developers.
256
+
257
+
`transformationPosition` is optional. The default value for this parameter is `path`. Acceptable values are `path` & `query`
258
+
259
+
_Note: Do not include your Private Key in any client-side code, including this SDK or its initialization. If you pass the `privateKey` parameter while initializing this SDK, it throws an error_
260
+
346
261
## Image resizing
347
262
348
263
The `IKImage` component renders an `img` tag. It is used for rendering and manipulating images in real time. `IKImage` component accepts the following props:
| urlEndpoint | String | Optional. The base URL to be appended before the path of the image. If not specified, the URL-endpoint specified at the time of [SDK initialization](#initialization) is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/|
267
+
| urlEndpoint | String | Optional. The base URL to be appended before the path of the image. If not specified, the URL-endpoint specified in the parent `IKContext` component is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/|
353
268
| path | String |Conditional. This is the path at which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
354
269
| src | String |Conditional. This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
355
270
| transformation | Array of objects |Optional. An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. See list of [different tranformations](#list-of-supported-transformations). Different steps of a [chained transformation](https://docs.imagekit.io/features/image-transformations/chained-transformations) can be specified as the array's different objects. The complete list of supported transformations in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it is applied in the URL as it is. |
@@ -362,26 +277,28 @@ The `IKImage` component renders an `img` tag. It is used for rendering and manip
362
277
363
278
```js
364
279
// Image from related file path with no transformations - https://ik.imagekit.io/your_imagekit_id/default-image.jpg
// Using a new tranformation parameter which is not there in this SDK yet - https://ik.imagekit.io/your_imagekit_id/tr:custom-value/default-image.jpg
381
-
<IKImage
382
-
path="/default-image.jpg"
383
-
:transformation="[{custom: 'value'}]"
384
-
/>
296
+
// Using a new tranformation parameter which is not there in this SDK yet - https://ik.imagekit.io/your_imagekit_id/tr:custom-value/default-image.jpg
297
+
<IKImage
298
+
path="/default-image.jpg"
299
+
:transformation="[{custom: 'value'}]"
300
+
/>
301
+
</IKContext>
385
302
```
386
303
387
304
The `transformation` prop is an array of objects. Each object can have the following properties. When you specify more than one object, each object is added as a chained transformation. For example:
@@ -656,9 +570,9 @@ The SDK provides the `IKUpload` component to upload files to the [ImageKit Media
656
570
| validateFile | Function callback | Optional. Called before the upload is started to run custom validation. The first and only argument is the file selected for upload. If the callback returns `true`, the upload is allowed to continue. But, if it returns `false`, the upload is not done |
657
571
| onSuccess | Function callback | Optional. Called if the upload is successful. The first and only argument is the response JSON from the upload API. The request-id, response headers, and HTTP status code are also accessible using the $ResponseMetadata key that is exposed from the [javascript sdk](https://github.com/imagekit-developer/imagekit-javascript#access-request-id-other-response-headers-and-http-status-code)|
658
572
| onError | Function callback | Optional. Called if upload results in an error. The first and only argument is the error received from the upload API |
659
-
| urlEndpoint | String | Optional. If not specified, the URL-endpoint specified at the time of [SDK initialization](#initialization) is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/|
660
-
| publicKey | String | Optional. If not specified, the `publicKey` specified at the time of [SDK initialization](#initialization) is used.|
661
-
| authenticator | ()=>Promise<{signature:string,token:string,expiry:number}> | Optional. If not specified, the `authenticator` specified at the time of [SDK initialization](#initialization) is used. |
573
+
| urlEndpoint | String | Optional. If not specified, the URL-endpoint specified in the parent `IKContext` component is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/|
574
+
| publicKey | String | Optional. If not specified, the `publicKey` specified in the parent `IKContext` component is used.|
575
+
| authenticator | ()=>Promise<{signature:string,token:string,expiry:number}> | Optional. If not specified, the `authenticator` specified in the parent `IKContext` component is used. |
662
576
663
577
> Make sure that you have specified authenticator and publicKey in IKUpload or in the parent IKContext component as a prop. The authenticator expects an asynchronous function that resolves with an object containing the necessary security parameters i.e signature, token, and expire.
664
578
@@ -679,14 +593,6 @@ Sample file upload:
679
593
680
594
<script>
681
595
import { IKUpload } from"imagekitio-vue"
682
-
import { createApp } from'vue';
683
-
684
-
constapp=createApp({});
685
-
686
-
app.use(ImageKit, {
687
-
urlEndpoint:"your_url_endpoint", // Required. Default URL-endpoint is https://ik.imagekit.io/your_imagekit_id
688
-
publicKey:"your_public_api_key", // optional
689
-
})
690
596
691
597
exportdefault {
692
598
name:"app",
@@ -738,14 +644,6 @@ Example Usage
738
644
739
645
<script>
740
646
import { IKUpload } from"imagekitio-vue"
741
-
import { createApp } from'vue';
742
-
743
-
constapp=createApp({});
744
-
745
-
app.use(ImageKit, {
746
-
urlEndpoint:"your_url_endpoint", // Required. Default URL-endpoint is https://ik.imagekit.io/your_imagekit_id
0 commit comments