References

Use the library

Include this javascript bundle in the html

<script src="https://static.iadvize.com/conversation-panel-app-lib/2.9.0/idzcpa.umd.production.min.js"></script>

Client

idzCpa

Global cariable used as the entry point of the CPA library, stored in window

init() : Promise

Client is obtained using idzCpa.init that returns a Promise

window.idzCpa.init().then(client => {
    //some code
})

context

Returns the client's information in the form of a Context object

 type Context = {
    conversationId: string;
    projectId: string;
    channel: Channel;
    language: string;
}

conversationId : id of the conversation between the client and the operator

projectId : Id of the project you launch the desk on

channel : Type of channel :

language : language of the client

insertTextInComposeBox(string)

Insert the text passed in parameters into the compose box

pushCardInConversationThreat(Card)

Push the card passed in parameters into the conversation thread

Push the card bundle passed in parameters in the conversation thread

getJWT() : string

Returns the JWT of the desk

ApplePay

pushApplePayPaymentRequestInConversationThread(ApplePayPaymentRequestType) : Promise

Insert an ApplePay payment request in the conversation, returns a promise. If the payment is successful => execute promise.then(()=>{ }) If there is an error in the payment => execute promise.catch((e : ActionError)=>{ })

Last updated

Was this helpful?