Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I listen to multiple accounts? #66

Open
meseven opened this issue Mar 7, 2021 · 2 comments
Open

How can I listen to multiple accounts? #66

meseven opened this issue Mar 7, 2021 · 2 comments
Labels

Comments

@meseven
Copy link

meseven commented Mar 7, 2021

Hi all,

I want to listen to messages sent to multiple accounts. The method below works but I'm not sure it's the right solution.

const ig = withRealtime(new IgApiClient());
const ig2 = withRealtime(new IgApiClient());

ig.realtime.on('message', (data) => console.log(data));
ig2.realtime.on('message', (data) => console.log(data));

What could be your solution for connecting to 10 separate accounts? How do I refactor this code?

@Nesslax
Copy link

Nesslax commented Apr 14, 2021

Hello meseven,

I have done the same thing for my platform. and this is the only solution i have found to be able to manage each account separately.

hope i helped

@bayramn
Copy link

bayramn commented Sep 8, 2021

Do you have any update on this issues? How to listen multiple accounts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants