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
Copy file name to clipboardExpand all lines: README.md
+46-46Lines changed: 46 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -12,53 +12,53 @@ ImageKit Vue.js SDK allows you to use real-time [image resizing](https://docs.im
12
12
## Breaking changes - Upgrading from 1.x to 2.x version
13
13
2.x version has breaking changes as listed below.
14
14
15
-
* In version 2.0.0, three global components, namely `ik-image`, `ik-upload`, and `ik-context`, are no longer supported. Instead, it is recommended to import these components individually.
* In version 2.0.0, we have deprecated the use of the `authenticationEndpoint` parameter. Instead, the SDK has introduced a new parameter named `authenticator`. This parameter expects an asynchronous function that resolves with an object containing the necessary security parameters i.e `signature`, `token`, and `expire`.
32
-
33
-
An example implementation for `authenticator` using `Fetch API`.
34
-
35
-
```javascript
36
-
37
-
constauthenticator=async () => {
38
-
try {
39
-
40
-
// You can also pass headers and validate the request source in the backend, or you can use headers for any other use case.
41
-
constheaders= {
42
-
'CustomHeader':'CustomValue'
43
-
};
44
-
45
-
constresponse=awaitfetch('server_endpoint', {
46
-
headers
47
-
});
48
-
49
-
if (!response.ok) {
50
-
consterrorText=awaitresponse.text();
51
-
thrownewError(`Request failed with status ${response.status}: ${errorText}`);
15
+
1. In version 2.0.0, three global components, namely `ik-image`, `ik-upload`, and `ik-context`, are no longer supported. Instead, it is recommended to import these components individually.
2. We have deprecated the use of the `authenticationEndpoint`parameter. Instead, the SDK has introduced a newparameter named `authenticator`. This parameter expects an asynchronous function that resolves with an object containing the necessary security parameters i.e `signature`, `token`, and `expire`.
32
+
33
+
An example implementation for `authenticator` using `Fetch API`.
34
+
35
+
``` javascript
36
+
37
+
const authenticator = async () => {
38
+
try {
39
+
40
+
// You can also pass headers and validate the request source in the backend, or you can use headers for any other use case.
41
+
constheaders= {
42
+
'CustomHeader':'CustomValue'
43
+
};
44
+
45
+
constresponse=awaitfetch('server_endpoint', {
46
+
headers
47
+
});
48
+
49
+
if (!response.ok) {
50
+
consterrorText=awaitresponse.text();
51
+
thrownewError(`Request failed with status ${response.status}: ${errorText}`);
*Note*: Avoid generating security parameters on the client side. Always send a request to your backend to retrieve security parameters, as the generation of these parameters necessitates the use of your Imagekit `privateKey`, which must not be included in client-side code.
0 commit comments