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
+42-25Lines changed: 42 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,22 +7,41 @@
7
7
8
8
Javascript SDK for [ImageKit.io](https://imagekit.io) that implements the client-side upload and URL generation for use in the browser.
9
9
10
-
ImageKit is a complete image optimization and transformation solution that comes with an [image CDN](https://imagekit.io/features/imagekit-infrastructure) and media storage. It can be integrated with your existing infrastructure - storage like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
10
+
ImageKit is a complete image optimization and transformation solution with an [image CDN](https://imagekit.io/features/imagekit-infrastructure) and media storage. It can be integrated with your existing infrastructure - storage like AWS S3, web servers, your CDN, and custom domain names. It allows you to deliver optimized images in minutes with minimal code changes.
11
11
12
12
This SDK has no dependency.
13
13
14
14
## Installation
15
15
16
-
Download the `imagekit.js` file from the dist directory or using the following command. Use the optional `--save` parameter if you wish to save the dependency in your `package.json` file.
17
-
16
+
### Using npm
17
+
Install `imagekit-javascript`
18
18
```
19
19
npm install imagekit-javascript
20
20
```
21
21
22
-
Load it using a `<script>` tag.
22
+
Now import ImageKit
23
+
```js
24
+
importImageKitfrom"imagekit-javascript"
25
+
26
+
// or
27
+
constImageKit=require("imagekit-javascript")
28
+
```
29
+
30
+
### Using CDN
31
+
You can download a specific version of this SDK from a global CDN.
*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*
42
61
43
-
## Usage
62
+
## Demo Application
63
+
64
+
The fastest way to get started is by running the demo application. You can run the code locally. The source code is in [samples/sample-app](https://github.com/imagekit-developer/imagekit-javascript/tree/master/samples/sample-app).
Create a file `.env` using `sample.env` in the directory `samples/sample-app` and fill in your `PRIVATE_KEY`, `PUBLIC_KEY` and `URL_ENDPOINT` from your [imageKit dashboard](https://imagekit.io/dashboard#developers). The just run:
44
75
76
+
```
77
+
yarn startSampleApp
78
+
```
79
+
80
+
## Usage
45
81
You can use this SDK for URL generation and client-side file uploads.
46
82
47
83
### URL Generation
@@ -241,22 +277,3 @@ Sample usage
241
277
If the upload succeeds, `err` will be `null`, and the `result` will be the same as what is received from ImageKit's servers.
242
278
If the upload fails, `err` will be the same as what is received from ImageKit's servers, and the `result` will be null.
243
279
244
-
245
-
### Demo Application
246
-
247
-
The fastest way to get started is by running the demo application. You can run the code locally. The source code is in [samples/sample-app](https://github.com/imagekit-developer/imagekit-javascript/tree/master/samples/sample-app).
Create a file `.env` in the directory `samples/sample-app` and fill in your `PRIVATE_KEY`, `PUBLIC_KEY` and `URL_ENDPOINT` from your [imageKit dashboard](https://imagekit.io/dashboard#developers). The just run:
0 commit comments