You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,55 @@ var conversation = /* a Conversation object obtained from your app's server */;
140
140
directLine.reconnect(conversation);
141
141
```
142
142
143
+
### Resume an existing conversation
144
+
145
+
When using DirectLine with WebChat, closing the current tab or refreshing the page will create a new conversation in most cases. You can resume an existing conversation to keep the user in the same context.
146
+
147
+
**When using a secret** you can resume a conversation by:
148
+
- Storing the conversationid (in a *permanent* place, like local storage)
149
+
- Giving this value back while creating the DirectLine object along with the secret
token: /* the token you retrieved while reconnecting */,
170
+
streamUrl: /* the streamUrl you retrieved while reconnecting */,
171
+
conversationId: /* the conversationid you stored from previous conversation */
172
+
});
173
+
```
174
+
175
+
**Getting any history that Direct Line has cached** : you can retrieve history using watermarks:
176
+
You can see the watermark as an *activity 'bookmark'*. The resuming scenario will replay all the conversation activities from the watermark you specify. For now, this only works when using the polling version of DirectLine.
0 commit comments