I’m trying to figure out how to set up authentication for two different user accounts within a single Zapier CLI application. I’ve noticed that some existing apps offer this functionality, but I can’t find clear documentation or sample code that shows how to implement this feature.
When I look at the authentication structure, it seems like there’s only support for one auth handler:
Is there a way to modify this setup so users can authenticate with two separate accounts simultaneously? What’s the best approach to handle multiple authentication instances in the same app?
Zapier CLI’s authentication is built for single accounts, but you can hack around it using bundle.authData. I’ve done this before - create a custom auth flow where users enter credentials for both accounts during setup. Add extra input fields in your auth config to grab the second account’s credentials, then store both sets in separate properties within bundle.authData. The tricky part is handling token refresh for both accounts and making sure your API calls use the right credentials based on what operation you’re running. It’s more work to manage the auth state manually, but it works great once you get it set up right.
hey, so zapier cli doesnt support dual accounts directly. one way is to keep both tokens in the connectionLabel, or let users pick accounts with inputFields. some devs just have 2 app versions which works, but it’s kinda messy.
Zapier CLI makes this way harder than it needs to be. I’ve dealt with enterprise integrations before where you need to sync data between different accounts.
These workarounds with multiple auth flows and manual token management are just pain. You’re fighting against Zapier’s single account architecture. Maintaining two separate auth sessions gets messy when tokens expire.
Switching to Latenode changed everything for these complex scenarios. Instead of hacking around Zapier’s limitations, you can build proper multi-account workflows from scratch. You get full control over authentication without being locked into their single auth structure.
I recently built something where users needed to authenticate with both production and staging environments simultaneously. With Latenode, I handled multiple OAuth flows in the same workflow and managed separate credential sets cleanly.
The visual workflow builder makes it easier to see how your dual authentication logic flows compared to wrestling with CLI code. You don’t need bundle.authData hacks or complex token refresh logic.
Same issue here - super frustrating. I built separate auth middleware that switches accounts on the fly. During setup, I store tokens for both accounts, then use a custom header to tell the app which account to use per request. Takes some extra work but you get flexibility without messing up Zapier’s auth system.
Hit this exact problem last year building an integration that synced data between two service accounts. Zapier CLI’s auth object only handles single accounts, but here’s what worked for me. Don’t mess with the core auth structure. Instead, set up a multi-step process - let the initial auth grab the primary account, then add a separate trigger for the secondary account auth. Use bundle.inputData to store the second set of credentials and manage both auth states in your API calls. Watch out for token expiration since you’re juggling two separate auth sessions. Users have to authenticate twice, which sucks, but it’s way cleaner than cramming multiple accounts into one auth flow. You’ll need logic in your HTTP requests to pick the right credentials for each API call, so it gets a bit complex.