2.0.7 • Published 1 year ago

flamsdk v2.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Saaskit-javascript

Client Side SDK toolkit for SaaS.

If you want to read the full API documentation of SaasSdk, see here.

Index

You can checkout the demo here

Install

From CDN:

<!-- Latest patch release -->
<script src="https://unpkg.com/flamsdk@2.0.0/dist/FlamSaasSDK.min.js"></script>

From npm:

npm i flamsdk

or if using yarn:

yarn add flamsdk

After installing the flamsdk module using npm, you'll need to bundle it up along with all of its dependencies, or import it using:

import FlamSaasSDK from 'flamsdk';

FlamSaasSDK.init

Provides support for the initialization flow.

Initialize

const clientInit = {
  enviornment: 'sandbox | production', //optional, default to sandbox
  key: '{YOUR_FLAMSDK_KEY}'
};

const sdk = FlamSaasSDK.init(clientInit);

Parameters

All parameters can be considered optional unless otherwise stated.

OptionTypeDescription
enviornmentstring (optional)Environment to be loaded. If not given it uses sandbox.
keystring (required)Flam SDK key recieved from business.flamapp.com after signin up.

API

sdk.placeOrder(options, callback)

Loads an instance of the SDK in iframe on the client website. It takes all the necessary details from the client and injects it to the SDK for the user to place order and the status of the same can be fetched using a custom callback function passed by the client.

Parameters

All parameters can be considered optional unless otherwise stated.

OptionTypeDescription
productIdstring (required)Product ID for the product to be ordered from SDK
varientIdstring (required)Variant ID for the product to be ordered from SDK
refIdstring (required)Reference ID set up by the client for their convenience and tracking
photoobject (optional)The object with url can be passed if client wants the user to upload images on their own website instead of the FlamSDK
videoobject (optional)The object with url can be passed if client wants the user to upload video on their own website instead of the FlamSDK
colorobject (optional)color in the form of HEX, which can be passed by the client to customise the primary and secondary colour of the SDK UI according to their needs.
sdk.placeOrder(
  {
    productId: '96f0d15e-63cd-485b-8f37-bb474d287129',
    varientId: 'VARIANT-1',
    refId: '04607c6a-9964-47de-a0c2-853b3f89bd88',
    photo: {
	     url : 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
    },
    video: {
	      url: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
      },
    color: '#a62107',
  },
  function (err, result) {
    // Order pacement result or error
  }
);

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this Support Center.

Author

Flam

License

This project is licensed under the MIT license. See the LICENSE file for more info.

2.0.7-beta.0

1 year ago

2.0.5-beta.0

1 year ago

2.0.6-beta.0

1 year ago

2.0.5

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.8-alpha.0

1 year ago

2.0.8-alpha.2

1 year ago

2.0.8-alpha.1

1 year ago

2.0.4-beta.0

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.4

1 year ago

2.0.2-beta.0

1 year ago

2.0.1-beta.0

1 year ago

2.0.1

1 year ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.10

1 year ago

2.0.0

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago