Skip to content

Commit

Permalink
Update README to 1.0.6 features
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuvrajhere committed Oct 19, 2022
1 parent ecfa07a commit e2071f7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,35 +75,40 @@ Loads an instance of the SDK in iframe on the client website. It takes all the n

All parameters can be considered optional unless otherwise stated.

| Option | Type | Description |
| :---------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `productId` | string (required) | Product ID for the product to be ordered from SDK |
| `refId` | string (required) | Reference ID set up by the client for their convenience and tracking |
| `photo` | string (optional) | This can be passed if client wants the user to upload images on their own website instead of the FlamSDK |
| `video` | string (optional) | This can be passed if client wants the user to upload video on their own website instead of the FlamSDK |
| `prefill` | object (optional) | This is an object which contains the following options: `name: string` `email: string` `phone: string` for the user to contact the client in case of any errors |
| `animation` | string (optional) | This is the animation to be added on the experience which would be received from the `/products` API. In case not provided default one is used for the particular product |
| `theme` | object (optional) | This is an object which contains `color : string` in the form of **HEX**, which can be passed by the client to customise the primary colour of the SDK UI according to their needs. |
| `logo` | string (optional) | This is the logo of the client's organisation to be shown on the SDK. In case not provided a default logo would be used |
| `callback` | function (required) | This is a custom function which the client can pass to handle success and error states that occur in SDK. |
| Option | Type | Description |
| :---------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `productId` | string (required) | Product ID for the product to be ordered from SDK |
| `variantId` | string (required) | Variant ID for the product to be ordered from SDK |
| `refId` | string (required) | Reference ID set up by the client for their convenience and tracking |
| `allowVideoLater` | boolean (optional) | Allow users to upload the video later (default: false) |
| `photo` | string (optional) | This can be passed if client wants the user to upload images on their own website instead of the FlamSDK |
| `video` | string (optional) | This can be passed if client wants the user to upload video on their own website instead of the FlamSDK |
| `prefill` | object (optional) | This is an object which contains the following options: `name: string` `email: string` `phone: string` for the user to contact the client in case of any errors |
| `animation` | string (optional) | This is the animation to be added on the experience which would be received from the `/products` API. In case not provided default one is used for the particular product |
| `theme` | object (optional) | This is an object which contains `color : string` in the form of **HEX**, which can be passed by the client to customise the primary colour of the SDK UI according to their needs. |
| `logo` | string (optional) | This is the logo of the client's organisation to be shown on the SDK. In case not provided a default logo would be used |
| `callback` | function (required) | This is a custom function which the client can pass to handle success and error states that occur in SDK. |

```js
sdk.placeOrder(
{
productId: '96f0d15e-63cd-485b-8f37-bb474d287129',
refId: '04607c6a-9964-47de-a0c2-853b3f89bd88',
photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
video:'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
animation: 'CONFETTI',
theme: {
color : '#234f55',
},
prefill: {
name: 'John Doe Prints',
email: '[email protected]',
phone: '+91 98765 43210'
},
logo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Facebook_f_logo_%282019%29.svg/2048px-Facebook_f_logo_%282019%29.svg.png
productId: '96f0d15e-63cd-485b-8f37-bb474d287129',
variantId: 'VARIANT-1',
refId: '04607c6a-9964-47de-a0c2-853b3f89bd88',
allowVideoLater: true,
photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
video:
'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
animation: 'CONFETTI',
theme: {
color: '#234f55'
},
prefill: {
name: 'John Doe Prints',
email: '[email protected]',
phone: '+91 98765 43210'
},
logo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Facebook_f_logo_%282019%29.svg/2048px-Facebook_f_logo_%282019%29.svg.png'
},
function (err, result) {
// Order pacement result or error
Expand Down
2 changes: 1 addition & 1 deletion examples/vanilla-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function buyCard(productId, variantId) {

// const sample = {
// productId: productId,
// varientId: varientId,
// variantId: variantId,
// refId: random,
// photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
// video: '',
Expand Down

0 comments on commit e2071f7

Please sign in to comment.