Widget API: Conversation Sidebar

Updated 2 months ago ​by Sara Pion

If you would like to control when the conversation sidebar pops open, you can use these commands to help control those settings. This command can be called when you are trying to hide a bot campaign from certain pages. 

First make sure the Drift widget is initialized and ready for use

drift.on('ready',function(api, payload) {
  // interact with the api here
Here is an example using our Widget API

Drift conversation sidebar

  • Open- api.sidebar.open()

  • Close- api.sidebar.close()

  • Toggle- api.sidebar.toggle()

    • This will toggle the sidebar open or closed depending on the current state

  • Open sidebar to a new conversation -  api.goToNewConversation()


Was this article helpful?

Can’t find what you’re looking for?

Talk To Us