Skip to content

Commit 39a11c8

Browse files
committed
Update README and DEVELOPMENT
1 parent 25bbe26 commit 39a11c8

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

DEVELOPMENT.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,16 @@ Execute following command from the `sdk` folder to start testing.
1919
npm run test
2020
```
2121

22-
## Running sample angular app
22+
## Building custom SDK for sample angular app
23+
24+
Repository to get sample app: https://github.com/imagekit-samples/quickstart
2325

24-
Every sample app requires a different version of Angular CLI. Please refer to the individual sample app `Readme.md` for details.
2526
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.
2627

2728
1. In the `sdk` folder, install dependencies with `npm install`
2829
2. Build library with `npm run build`
2930
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.
30-
4. Go to `samples/imagekitio-angular-sample` folder and use `npm install` to install dependencies.
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`
31+
4. Go to the Angular sample app's root folder and use `npm install` to install dependencies.
32+
5. Use `npm install <path to this SDK>/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 <path to this SDK>/sdk/dist/imagekitio-angular/imagekitio-angular-2.0.0.tgz`
3233
6. Configure sample app with required keys. Use each app's `Readme.md` for exact details.
33-
7. Use npm start from the `samples/imagekitio-angular-sample` folder to run the app for a particular angular version.
34-
35-
## Running sample backend server
36-
37-
Sample server for upload implementation is available at `samples/sample-server`. To run the server, follow these steps
38-
39-
1. Create a `.env` file based on `sample.env` and enter your private key.
40-
2. Use `npm install` to install dependencies.
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`
34+
7. Use npm start from the Angular sample app's root folder to run the app

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@ Sample Usage
549549
| 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 |
550550
| onSuccess | Function callback | Optional. EventEmitter. 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) |
551551
| onError | Function callback | Optional. EventEmitter. Called if upload results in an error. The first and only argument is the error received from the upload API |
552+
| urlEndpoint | String | Optional. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/ |
553+
| publicKey | String | Optional |
554+
| authenticationEndpoint | String | Optional |
555+
556+
Note: All three `urlEndpoint`, `publicKey` and `authenticationEndpoint` must be present in the attribute for them to take effect. Otherwise, the SDK will fall back to the values specified in `app.module.ts`.
552557

553558
Sample usage
554559

0 commit comments

Comments
 (0)