Skip to content

Commit 095b7c9

Browse files
Manu ChaudharyManu Chaudhary
authored andcommitted
version and readme update
1 parent 047804a commit 095b7c9

File tree

14 files changed

+372
-381
lines changed

14 files changed

+372
-381
lines changed

DEVELOPING.md

Lines changed: 13 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,41 @@
1-
# Developing Imagekit Angular SDK
2-
3-
This document describes how to develop Imagekit Angular SDK.
4-
5-
- [Setting up development environment](#setting-up-development-environment)
6-
- [Building the project](#building-the-project)
7-
8-
## Setting up development environment
9-
10-
Before you can start developing, you need to install and configure a few dependencies,
11-
12-
- [git](https://git-scm.com/): Github's
13-
[Set Up Git](https://help.github.com/articles/set-up-git/) guide is a good
14-
source of information.
15-
- [Node.js 10.x (LTS)](https://nodejs.org/en/download/)
16-
17-
You may want to configure your IDE or editor to get better support for
18-
TypeScript too.
19-
20-
- [VisualStudio Code](./VSCODE.md)
21-
22-
Before getting started, it is recommended to configure `git` so that it knows
23-
who you are:
24-
25-
```sh
26-
git config --global user.name "I am Random"
27-
git config --global user.email "[email protected]"
28-
```
29-
30-
Please make sure this local email is also added to your
31-
[GitHub email list](https://github.com/settings/emails) so that your commits
32-
will be properly associated with your account and you will be promoted to
33-
Contributor once your first commit is landed.
34-
35-
## Building the project
36-
37-
The project consists of following major parts
38-
39-
- sdk (contains the SDK code)
40-
- samples (sample usage and usage example with other angular versions)
41-
42-
### SDK development
1+
## SDK development
432

443
SDK is build in angular 4 for forward compatibilty and `ng-packagr` is used to create final package. Make sure `@angular/cli` is at `v1.4.*` before building the package.
454

46-
### Building package
5+
## Building package
476

48-
Use
7+
Execute following command from the `sdk` folder to build the library. This creates a package in `dist/imagekitio-angular` folder.
498
```sh
9+
# run `npm install` for first time
5010
npm run build
5111
```
52-
from the `sdk` folder to build the library. This creates a package in `dist/imagekitio-angular` folder.
5312

54-
### Running Tests
13+
## Running test cases
5514

5615
The designated directory for tests is `sdk/src/sdk-tests` folder. All tests will be executed once on the Chrome Headless browser.
5716

58-
Use
17+
Execute following command from the `sdk` folder to start testing.
5918
```sh
6019
npm run test
6120
```
62-
from the `sdk` folder to start testing.
6321

64-
### Running Sample Apps
22+
## Running sample angular app
6523

66-
Every sample app requires a different version of Angular CLI. Please refer to individual sample app `Readme.md` for details.
67-
Before sample apps can be used, `imagekitio-angular` library needs to be packed and installed using file system within the sample apps. Use the following steps to run any sample app.
24+
Every sample app requires a different version of Angular CLI. Please refer to the individual sample app `Readme.md` for details.
25+
Before sample apps can be used, `imagekitio-angular` library needs to be packed and installed using the file system within the sample apps. Use the following steps to run any sample app.
6826

6927
1. In the `sdk` folder, install dependencies with `npm install`
7028
2. Build library with `npm run build`
7129
3. In the `sdk/dist/imagekitio-angular` folder, use `npm pack` to create a tarball with version mentioned in the current package.json for sdk.
7230
4. Go to `samples/imagekitio-angular<x>-sample` folder and use `npm install` to install dependencies.
73-
5. Use `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-x.x.x.tgz` where x.x.x needs to be replaced with current version. For example, sdk version is `0.0.1`, then above command becomes `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-0.0.1.tgz`
31+
5. Use `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-x.x.x.tgz` where x.x.x needs to be replaced with the current version. For example, SDK version is `0.0.1`, then above command becomes `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-0.0.1.tgz`
7432
6. Configure sample app with required keys. Use each app's `Readme.md` for exact details.
75-
7. Use npm start from the `samples/imagekitio-angular<x>-sample` folder to run app for particular angular version.
33+
7. Use npm start from the `samples/imagekitio-angular<x>-sample` folder to run the app for a particular angular version.
7634

77-
### Running Sample Server
35+
## Running sample backend server
7836

7937
Sample server for upload implementation is available at `samples/sample-server`. To run the server, follow these steps
8038

8139
1. Create a `.env` file based on `sample.env` and enter your private key.
8240
2. Use `npm install` to install dependencies.
83-
3. Use `npm run server` to start the server.
41+
3. Use `npm run server` to start the server. It will expose the [authentication endpoint](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) on `http://localhost:3000/auth`

README.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# [WIP] ImageKit.io Angular SDK
1+
# ImageKit.io Angular SDK
22

33
[![Node CI](https://github.com/imagekit-developer/imagekit-angular/workflows/Node%20CI/badge.svg)](https://github.com/imagekit-developer/imagekit-angular/)
44
[![npm version](https://img.shields.io/npm/v/imagekitio-angular)](https://www.npmjs.com/package/imagekitio-angular)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66
[![Twitter Follow](https://img.shields.io/twitter/follow/imagekitio?label=Follow&style=social)](https://twitter.com/ImagekitIo)
77

8-
Angular SDK for [ImageKit.io](https://imagekit.io) which implements client-side upload and URL generation for use inside an angular application.
8+
Angular SDK for [ImageKit.io](https://imagekit.io), which implements client-side upload and URL generation for use inside an angular application.
99

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 - storages 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 that comes with an [image CDN](https://imagekit.io/features/imagekit-infrastructure) and media storage. It can be integrated with your existing infrastructure - storages like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
1111

1212
## Installation
1313

@@ -52,7 +52,7 @@ In order to use the SDK, you need to provide it with a few configuration paramet
5252
`authenticationEndpoint` is essential if you want to use the SDK for client-side uploads.
5353
`transformationPosition` is optional. The default value for the parameter is `path`. Acceptable values are `path` & `query`
5454

55-
_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_
55+
_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_
5656

5757
### ik-image
5858

@@ -143,7 +143,7 @@ const transformations = [{
143143
The above image will apply transformation of width = 90 and height = 180 on the image. Since some transformatinos are destructive you might want to control the order in which the transforms are applied.
144144

145145
##### Chained Transforms
146-
Chained transforms make it easy to specify the order the transform are applied. example:
146+
Chained transformations provide a simple way to control the sequence in which transformations are applied.
147147

148148
```js
149149
const transformations = [
@@ -156,7 +156,7 @@ const transformations = [
156156
}
157157
];
158158
```
159-
In the above case, rotation will be performed first and resizing according to width and aspect ratio will be performed afterwards.
159+
In the above case, the rotation will be performed first, and resizing according to width and aspect ratio will be performed afterward.
160160

161161
#### Low Quality Image Placeholders (LQIP) for images
162162
The SDK supports automatic support for LQIP for your images, if you set lqip to true in the image component. example:
@@ -168,21 +168,42 @@ The SDK supports automatic support for LQIP for your images, if you set lqip to
168168
`quality` decided the quaility of placeholder image. It can be any numeric value, a low number means low quality, and high number means high quality.
169169

170170
##### How does the lqip work?
171-
The component tries to keep the it simple, it loads a lower quality image using the quality parameter to load a lower quality image, which is then replaced with the actual quality image later.
171+
The component tries to keep it simple. It loads a lower quality image using the quality parameter to load a lower quality image, which is then replaced with the actual quality image later.
172172

173173
## File Upload
174174
#### ik-upload
175175
The SDK provides a simple Component to upload files to the ImageKit Media Library. It has an attribute called `fileName` which is used by SDK for `fileName` parameter required to upload. The `file` parameter is provided as an input from the user.
176176

177-
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`.
177+
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`.
178178

179179
[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.
180180

181181
An example of this server is provided in the sample-server folder of the SDK.
182182

183183
Sample Usage
184184
```js
185+
// Simple upload
185186
<ik-upload fileName="my-upload" /></ik-upload>
187+
188+
// Using callbacks and other parameters of upload API
189+
<ik-upload fileName="test_new" [useUniqueFileName]="false" [isPrivateFile]="true"
190+
(onSuccess)="handleUploadSuccess($event)" (onError)="handleUploadError($event)"></ik-upload>
186191
```
187192

188193
`ik-upload` component accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#request-structure-multipart-form-data) as attributes e.g. `tags`, `useUniqueFileName`, `folder`, `isPrivateFile`, `customCoordinates` etc.
194+
195+
## Sample application
196+
The `samples` folder contains a fully working sample angular application for angular versions 4, 5, 6, 7, and 8. Every application has a README.md file with full instructions on how to run it locally.
197+
198+
## Support
199+
200+
For any feedback or to report any issues or general implementation support, please reach out to [[email protected]](mailto:[email protected])
201+
202+
## Links
203+
204+
- [Documentation](https://docs.imagekit.io)
205+
- [Main website](https://imagekit.io)
206+
207+
## License
208+
209+
Released under the MIT license.

samples/imagekitio-angular4-sample/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
1010
@angular/cli: 1.4.10
1111
```
1212

13-
## Runnning the application
13+
## Running the application
1414

1515
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
1616

samples/imagekitio-angular4-sample/src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ImagekitioAngularModule } from "imagekitio-angular";
1111
ImagekitioAngularModule.forRoot({
1212
urlEndpoint: "<YOUR_URL_ENDPOINT>",
1313
publicKey: "<YOUR_PUBLIC_KEY>",
14-
authenticationEndpoint: "<YOUR_AUTH_ENDPOINT>"
14+
authenticationEndpoint: "<YOUR_AUTH_ENDPOINT e.g http://localhost:3000/auth>"
1515
})
1616
],
1717
providers: [],

samples/imagekitio-angular5-sample/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Imagekit Angular 5 Sample
22

3-
This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please note that you need to have `@angular/cli v1.6.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
3+
This project shows the usage of ImageKit Angular SDK in an Angular 5 app. Please note that you need to have `@angular/cli v1.6.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
44

55

66
```sh
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
1010
@angular/cli: 1.6.6
1111
```
1212

13-
## Runnning the application
13+
## Running the application
1414

1515
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
1616

samples/imagekitio-angular5-sample/src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { ImagekitioAngularModule } from "imagekitio-angular";
1414
ImagekitioAngularModule.forRoot({
1515
urlEndpoint: "<YOUR_URL_ENDPOINT>",
1616
publicKey: "<YOUR_PUBLIC_KEY>",
17-
authenticationEndpoint: "<YOUR_AUTH_ENDPOINT>"
17+
authenticationEndpoint: "<YOUR_AUTH_ENDPOINT e.g http://localhost:3000/auth>"
1818
})
1919
],
2020
providers: [],

samples/imagekitio-angular6-sample/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Imagekit Angular 6 Sample
22

3-
This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please note that you need to have `@angular/cli v6.1.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
3+
This project shows the usage of ImageKit Angular SDK in an Angular 6 app. Please note that you need to have `@angular/cli v6.1.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
44

55

66
```sh
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
1010
@angular/cli: 6.1.1
1111
```
1212

13-
## Runnning the application
13+
## Running the application
1414

1515
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
1616

samples/imagekitio-angular6-sample/src/app/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { ImagekitioAngularModule } from "imagekitio-angular";
1111
imports: [
1212
BrowserModule,
1313
ImagekitioAngularModule.forRoot({
14-
urlEndpoint: "",
15-
publicKey: "",
16-
authenticationEndpoint: ""
14+
urlEndpoint: "<YOUR_URL_ENDPOINT>",
15+
publicKey: "<YOUR_PUBLIC_KEY>",
16+
authenticationEndpoint: "<YOUR_AUTH_ENDPOINT e.g http://localhost:3000/auth>"
1717
})
1818
],
1919
providers: [],

samples/imagekitio-angular7-sample/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Imagekit Angular 6 Sample
1+
# Imagekit Angular 7 Sample
22

3-
This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please note that you need to have `@angular/cli v7.*.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
3+
This project shows the usage of ImageKit Angular SDK in an Angular 7 app. Please note that you need to have `@angular/cli v7.*.*` installed to run this application. If you are on latest version, you can uninstall current version and install required one like this:
44

55

66
```sh
@@ -10,7 +10,7 @@ This project shows the usage of ImageKit Angular SDK in an Angular 4 app. Please
1010
@angular/cli: 7.3.8
1111
```
1212

13-
## Runnning the application
13+
## Running the application
1414

1515
Before you can use Imagekit SDK, you need to provide config values required in `app.module.ts` and `app.component.ts`. You can either configure your environment and take values from there, or directly provide in respective files.
1616

samples/imagekitio-angular7-sample/src/app/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import { ImagekitioAngularModule } from "imagekitio-angular";
1212
BrowserModule,
1313
AppRoutingModule,
1414
ImagekitioAngularModule.forRoot({
15-
urlEndpoint: "",
16-
publicKey: "",
17-
authenticationEndpoint: ""
15+
urlEndpoint: "<YOUR_URL_ENDPOINT>",
16+
publicKey: "<YOUR_PUBLIC_KEY>",
17+
authenticationEndpoint: "<YOUR_AUTH_ENDPOINT e.g http://localhost:3000/auth>"
1818
})
1919
],
2020
providers: [],

0 commit comments

Comments
 (0)