1

I'm looking for a way of propagating information between the authentication script I've setup in my Zapier app and the different actions/triggers I have.

For now it would be a URL defined in a custom zapier form when authenticating a user that I could spread across all the actions/triggers scripts to make the calls properly using a context variable somewhere (not existing in bundle apparently).

I guess the environment global var is not the way as it's not bound to a specific zap but for all usages of the app.

Thank you for your help!

Vlad
  • 287
  • 3
  • 13

1 Answers1

1

David here, from the Zapier Platform team. Great question!

If you're looking for data that will be unique to each user, but consistent across each of that user's zaps, you're looking for auth fields! They're filled out when a user authenticates (enters their password, connects oauth, etc) and are accessible to all zaps that use that auth via bundle.authData. A user might have multiple auths (in the case of multiple accounts with your service), and each one will have its own version of the auth fields.

Hope this helps. ​Let me know if you've got any other questions!

xavdid
  • 5,092
  • 3
  • 20
  • 32
  • Thank you very much! It was not really obvious indeed as the `bundle.authData` payload displayed in the logs was: `{ "_zapier_account_id": ":censored:7:774801c61d:", "url": ":censored:32:c1e8a96630:", "_zapier_auth_id": ":censored:8:d5e4ae231a:", "access_token": ":censored:32:2df9657863:", ":censored:6:a5023f748d:": ":censored:6:a5023f748d:", "refresh_token": ":censored:64:7013104d3b:" }` :) So the url property here is resolved behind the scene? (even in the http logs of zapier, i have `:censored:32:c1e8a96630` in the URL) – Vlad Dec 03 '18 at 15:14
  • 1
    correct, `bundle.authData.url` is the field you (presumably) added on your end and the user filled out. We're careful to censor any of that before it gets out of our system. Sometimes we're over-eager so things that aren't _really_ secret get censored, but it's better to err on the cautious side. – xavdid Dec 03 '18 at 22:56