Skip to content

Commit 4af3519

Browse files
Manu ChaudharyManu Chaudhary
authored andcommitted
Sample app and readme update
1 parent c84facf commit 4af3519

File tree

3 files changed

+22
-14645
lines changed

3 files changed

+22
-14645
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Include the components in your code:
2222
The library includes 3 Components:
2323
* [IKContext](#IKContext)
2424

25-
* [IKImage](#IKImage)
25+
* [IKImage - URL generation](#IKImage)
2626

27-
* [IKUpload](#file-upload)
27+
* [IKUpload - File upload](#file-upload)
2828

2929
### IKContext
3030

@@ -45,7 +45,7 @@ In order to use the SDK, you need to provide it with a few configuration paramet
4545

4646
_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_
4747

48-
### IKImage
48+
### IKImage - URL generation
4949

5050
The IKImage component component defines an ImageKit Image tag. example usage:
5151

@@ -163,7 +163,7 @@ The SDK supports automatic support for LQIP for your images, if you set lqip to
163163
##### How does the lqip work?
164164
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.
165165

166-
#### File Upload
166+
### IKUpload - File Upload
167167
The SDK provides a simple Component to upload files to the ImageKit Media Library. It accepts `fileName` parameter as a prop. The file parameter is provided as an input from the user.
168168

169169
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`.
@@ -184,7 +184,7 @@ Sample Usage
184184

185185
`IKUpload` 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 props e.g. `tags`, `useUniqueFileName`, `folder` etc.
186186

187-
We also equip the user with two props `onSuccess` and `onError` to handle success and failure, respectively. You can pass your custom functions to handle the response as you require it to be,
187+
You can use `onSuccess` and `onError` callbacks to handle success and failure, respectively. You can pass your custom functions to handle the response from API.
188188

189189
```js
190190
const onError = err => {
@@ -204,8 +204,10 @@ const onSuccess = res => {
204204
<IKUpload fileName="custom_file_name" onError={onError} onSuccess={onSuccess} />
205205
</IKContext>
206206
```
207+
## Demo Application
208+
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. For the instructions in [readme.md](https://github.com/imagekit-developer/imagekit-react/blob/test-case/samples/sample-app/README.md) file within [samples/sample-app](https://github.com/imagekit-developer/imagekit-react/tree/test-case/samples/sample-app) folder.
207209

208-
#### Error Handling
210+
## Error Handling
209211
We are using Error Boundaries to handle errors in the UI. `ErrorBoundary` is used to handle errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed. example:
210212

211213
```js
@@ -216,3 +218,15 @@ We are using Error Boundaries to handle errors in the UI. `ErrorBoundary` is use
216218
}]} />
217219
</ErrorBoundary>
218220
```
221+
222+
## Support
223+
224+
For any feedback or to report any issues or general implementation support please reach out to [[email protected]](mailto:[email protected])
225+
226+
## Links
227+
* [Documentation](https://docs.imagekit.io)
228+
* [Main website](https://imagekit.io)
229+
230+
## License
231+
232+
Released under the MIT license.

0 commit comments

Comments
 (0)