Commerce.ClientOptions
ClassSpecifies the configuration for creating a commerce client.
- Snapchat: not supported
- SPECS: fully supported
- Camera Kit Web: not supported
- Camera Kit Mobile: not supported
- SnapchatNot supported — Available on SPECS only
- SPECSFully supported
- Camera Kit WebNot supported — Available on SPECS only
- Camera Kit MobileNot supported — Available on SPECS only
Specifies the configuration for creating a commerce client.
It defines important behaviors and callback functions, such as the onPurchasesUpdated,
which is essential for receiving real-time notifications about the status of user purchases.
Index
Properties
Methods
Extends
Constructors
Constructor
new ClientOptions(
onPurchasesUpdated):ClientOptions
Parameters
| Parameter | Type |
|---|---|
onPurchasesUpdated | (result, purchases) => void |
Returns
ClientOptions
Overrides
ScriptObject.constructor
Properties
extras
extras:
string
SPECS
An optional field that intended for advanced configuration of the CommerceKit client and is not recommended for general developer use. It accepts a JSON-formatted string to allow for flexible customization of the commerce module's behavior, primarily through various settings or extra data, to meet specific internal requirements or features.
Default Value
null
@snapOS
onPurchasesUpdated
onPurchasesUpdated: (
result,purchases) =>void
SPECS
Essential for receiving real-time updates on the status of user purchases.
It is invoked when a purchase is completed, cancelled, or encounters an error, allowing your Lens to react
appropriately (e.g., granting access to a purchased item or displaying an error message).
The result parameter provides a summary of the outcome, and the optional purchases array contains details
of the transactions if successful.
Parameters
| Parameter | Type |
|---|---|
result | PurchaseResult |
purchases | Purchase[] |
Returns
void
Default Value
null
@snapOS
Methods
getTypeName()
staticgetTypeName():TypeName<ClientOptions>
SPECS
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<ClientOptions>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean