Skip to content

Commit dcfc0a5

Browse files
Manu ChaudharyManu Chaudhary
authored andcommitted
Doc update
1 parent ab95427 commit dcfc0a5

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,9 @@ The complete list of transformations supported and their usage in ImageKit can b
193193

194194
The SDK provides a simple interface using the `.upload()` method to upload files to the ImageKit Media Library. It accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload).
195195

196-
The `upload()` method requires at least the `file` and the `fileName` parameter as an input from the user. The `publicKey` parameter is added automatically. Additionally, this method uses the `authenticationEndpoint` that is specified at the time of SDK initialization. Client-side file upload requires a token, expiry timestamp and signature, and these values can be safely generated on the server-side using your ImageKit account's private key.
196+
The `upload()` method requires `file` and the `fileName` parameter. Also make sure that you have specified `authenticationEndpoint` during SDK initialization. The SDK makes an HTTP GET request to this endpoint and expects a JSON response with three fields i.e. `signature`, `token` and `expire`.
197197

198-
The SDK issues a GET request to the authentication endpoint provided and the endpoint must respond with a JSON object with the values for `token`, `signature` and `expire`.
199-
200-
For example, you can use ImageKit's NodeJS SDK which implements the `getAuthenticationParameters` method to create a simple API endpoint like this on your server and provide the API endpoint as the `authenticationEndpoint` parameter.
201-
202-
```
203-
app.get('/auth', function(req, res) {
204-
res.send(imagekit.getAuthenticationParameters());
205-
});
206-
```
207-
208-
This method returns a callback with the `error` and `result` as arguments.
198+
[Learn how to implement authenticationEndpoint](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) on your server.
209199

210200
You can pass other parameters supported by the ImageKit upload API using the same parameter name as specified in the upload API documentation. For example, to specify tags for a file at the time of upload use the `tags` parameter as specified in the [documentation here](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload).
211201

@@ -218,8 +208,9 @@ Sample usage
218208
<script type="text/javascript" src="../dist/imagekit.js"></script>
219209
220210
<script>
221-
// SDK initilization
222-
// authenticationEndpoint should be implemented on your server
211+
/* SDK initilization
212+
authenticationEndpoint should be implemented on your server. Learn more here - https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#how-to-implement-authenticationendpoint-endpoint
213+
*/
223214
var imagekit = new ImageKit({
224215
publicKey : "your_public_api_key",
225216
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id",

0 commit comments

Comments
 (0)