From 1fe4a51fdc619ab9e81c50e79cc7d588371c6b80 Mon Sep 17 00:00:00 2001 From: Pawan Jain Date: Thu, 5 Sep 2024 00:18:06 +0530 Subject: [PATCH] feat: add export subscribers scripts (#680) * feat: add export subscibers scripts * fix: replace code with gist link --- concepts/subscribers.mdx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/concepts/subscribers.mdx b/concepts/subscribers.mdx index 2d3c6edc..cd0ff9e4 100644 --- a/concepts/subscribers.mdx +++ b/concepts/subscribers.mdx @@ -191,3 +191,28 @@ Novu will create a subscriber if one does not exist and will update the existing You can create subscribers in bulk _(up to 500 at once)_ via the SDKs or [API](/api-reference/subscribers/bulk-create-subscribers). +## Export Subscribers + +Currently, Novu does not support exporting subscribers. However, [Get Subscribers API](/api-reference/subscribers/get-subscribers) can be used to fetch subscribers + + + +### Steps: +- `mkdir export_novu_subscribers` +- `cd export_novu_subscribers` +- create `fetch_subscribers.js` file and copy [export_novu_subscribers.js](https://gist.github.com/jainpawan21/8604b4b2c1582b419e837bdc72290696#file-export_novu_subscribers-js) gist code into this file. +- `npm init -y` +- `npm install axios fast-csv fs` +- Run `node fetch_subscribers.js` +- Subscribers are exported in `subscribers.csv` file + + + + +### Steps: +- Create file with name fetch_subscribers.sh and copy [export_novu_subscribers.sh](https://gist.github.com/jainpawan21/8604b4b2c1582b419e837bdc72290696#file-export_novu_subscribers-sh) gist code into this file. +- Run `chmod +x fetch_subscribers.sh` +- Run `./fetch_subscribers.sh` +- Subscribers are exported in `subscribers.csv` file + + \ No newline at end of file