crisp-im / crisp-sdk-web

:package: Include the Crisp chat widget from using frameworks such as React, VueJS, Angular...
https://www.npmjs.com/package/crisp-sdk-web
MIT License
39 stars 13 forks source link

Provide API equivalent to push set message:text #29

Closed huksley closed 5 months ago

huksley commented 6 months ago

Bug

How to open a window and prefill a chatbox user text with a value. In JS SDK, it is done by using:

$crisp.push(["set", "message:text", [msg]]);

Is there a method equivalent to do that? I was not able to find any. I am using "crisp-sdk-web": "^1.0.21".

Implementation

Would be great to have something like:

Crisp.chat.setMessageText(msg)
eliottvincent commented 5 months ago

Now possible with most recent version:

Crisp.message.setMessageText("I have a question");
huksley commented 4 months ago

Confirmed working @eliottvincent Using this code instead of $crisp.push(["set", "message:text", [msg]]);

baptistejamin commented 4 months ago

Confirmed working with the following code:

Crisp.message.setMessageText("I have a question");