All Collections
Versions 3.0 and 2.0
Implement
Portal 3.0
How to detect when the importer is closed
How to detect when the importer is closed
Elisa Dinsmore avatar
Written by Elisa Dinsmore
Updated over a week ago

This article is for Flatfile's Portal 3.0. If you'd like to check out the latest version of the Flatfile Data Exchange Platform, click here!

In version 2.0.0 and later of the Portal 3.0 SDK (@flatfile/sdk), the method to detect when the importer is closed has changed. Previously, it was possible to use something similar to this to act when the importer was closed:

this.importer.on('close', () => {

Now, version 2.0.0 has deprecated that method and the session close event is exposed in onInit. In your code, this could be implemented like this:

onInit: ({ session }) => {  session.on('close', () => {})
},

To see more information about the SDK for Portal 3.0, click here.

Did this answer your question?