@synchat/webchat 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Para mais informações sobre a Synchat, acesse [synchat.com.br](https://synchat
|
|
|
35
35
|
4. Clique em **Criar canal WebChat**.
|
|
36
36
|
5. Após a criação, o portal exibe o **token** do canal. **Copie e guarde** esse valor — ele será usado no componente no seu site.
|
|
37
37
|
|
|
38
|
-
O **token** identifica o canal
|
|
38
|
+
O **token** identifica o canal no widget; não o compartilhe publicamente.
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
@@ -55,7 +55,7 @@ npm install react react-dom @mui/material @mui/icons-material @emotion/react @em
|
|
|
55
55
|
|
|
56
56
|
## Uso básico
|
|
57
57
|
|
|
58
|
-
Importe o componente e informe o **token** (obtido no portal)
|
|
58
|
+
Importe o componente e informe o **token** (obtido no portal):
|
|
59
59
|
|
|
60
60
|
```tsx
|
|
61
61
|
import { WebChat } from "@synchat/webchat";
|
|
@@ -87,7 +87,6 @@ Exemplo de uso com **onStartChat** (conecte em `/ws/business/{businessId}` usand
|
|
|
87
87
|
```tsx
|
|
88
88
|
<WebChat
|
|
89
89
|
token="SEU_TOKEN_DO_PORTAL"
|
|
90
|
-
apiBaseUrl="https://api.synchat.com.br"
|
|
91
90
|
onStartChat={async (data) => {
|
|
92
91
|
// config.businessId está disponível após fetch da config
|
|
93
92
|
// Conectar ao WebSocket: wsBase/ws/business/${config.businessId}
|
|
@@ -133,7 +132,7 @@ VITE_WEBCHAT_TOKEN=seu_token_aqui
|
|
|
133
132
|
/>
|
|
134
133
|
```
|
|
135
134
|
|
|
136
|
-
|
|
135
|
+
Para customizar a cor do botão:
|
|
137
136
|
|
|
138
137
|
```tsx
|
|
139
138
|
<WebChat
|