@kite-tech/web-app-sdk

Prodigi print on demand shop SDK

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@kite-tech/web-app-sdk
2.0.23 years ago6 years agoMinified + gzip package size for @kite-tech/web-app-sdk in KB

Readme

Prodigi Print Shop SDK
Prodigi offers white label print on demand portals so you can sell to your users under your brand.
This SDK is compatible with the Prodigi Print on Demand Shop. Get your own branded instance at Prodigi Apps Dashboard.
With the Print Shop SDK, you can integrate your print shop app into your own site, launching it with pre-configured data, such as images, at run-time.

Table of Contents

Demo and examples

For a list of common use-cases and a demo sandbox visit: https://sdk.prodigi.com/print-shop

Installation

Install using NPM:
npm install @kite-tech/web-app-sdk

Usage

Import the package:
import { KiteWebAppSdk } from '@kite-tech/web-app-sdk';
Launch your shop using the launchFromJSON function and pass in your desired configuration:
const printShopConfig = {
    baseUrl: 'https://shop.prodigi.com/prodigi'
};

KiteWebAppSdk.launchFromJSON(printShopConfig);

API

| Property | Type | Required | Description | |--------------------|---------------------------------------------------------|----------|-------------------------------------------------------------------------| | baseUrl | string | YES | The complete URL of your shop | | config | ConfigObject | NO | Specify additional properties for launch | | checkoutUserFields | CheckoutUserFieldsObject | NO | User details to populate on checkout | | collectorImages | CollectorImagesArray | NO | Images passed in to your shop that can be applied to different products |

ConfigObject

| Property | Type | Required | Description | |---------------|---------|----------|-------------------------------------------------------| | startInNewTab | boolean | NO | Opens your shop in a new tab/window. Default is false | | customerid | string | NO | Custom identifier associated to your user |

CheckoutUserFieldsObject

| Property | Type | Required | Description | |-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------| | shippingAddress |
 {
recipient
firstname: string,
recipient
lastname: string,
address
line1: string,
address
line2: string,
city: string,
county
state: string,
postcode: string,
country: string,
} | NO | User shipping address to populate on checkout. All values are optional | | customerEmail | string | NO | Sets the user's email address when they reach the checkout | | termsOfService | boolean | NO | Sets whether to automatically agree to terms of service on checkout |

CollectorImagesArray

An array of objects having the following properties:
| Property | Type | Required | Description | |------------------|----------------------------------------------------------|----------|-----------------------------------------------------------------------| | dimensions |
 {
width: number,
height: number
} | YES | The dimensions of the image URL specified | | id | string | YES | Unique ID for the image | | isUploadComplete | boolean | YES | Specify whether the image upload is complete | | thumbnailUrl | string | YES | Lower resolution image URL, used for rendering previews in the browser| | url | string | YES | Full resolution image URL, used for printing |