Skip to content

Commit 9f7bfc5

Browse files
update version and readme
1 parent d2fb93d commit 9f7bfc5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,4 +573,20 @@ run();
573573

574574
A full example is here: https://github.com/CrystallizeAPI/libraries/blob/main/components/js-api-client/src/examples/dump-tenant.ts
575575

576+
## Image uploader
577+
578+
Uploading an image to Crystallize is a three step process:
579+
580+
- You first need to send a request to the PIM API to get a pre-signed URL to upload the file
581+
- Then, you send another request to upload the file and receive a key
582+
- Lastly, you can register the image in Crystallize using the key received in the previous step
583+
584+
To simplify this process, there is a _handleImageUpload_ function provided with the library. Here is how you would use it:
585+
586+
```javascript
587+
const image = await handleImageUpload(path, crystallizeClient, 'tenantID');
588+
```
589+
590+
This takes care of the first two steps, which means you receive a key you can then use to register your image in Crystallize.
591+
576592
[crystallizeobject]: crystallize_marketing|folder|625619f6615e162541535959

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@crystallize/js-api-client",
33
"license": "MIT",
4-
"version": "1.12.2",
4+
"version": "1.13.0",
55
"author": "Crystallize <[email protected]> (https://crystallize.com)",
66
"contributors": [
77
"Sébastien Morel <[email protected]>"

0 commit comments

Comments
 (0)