intercom / intercom-node

Node.js bindings for the Intercom API
https://developers.intercom.com
Other
362 stars 116 forks source link

Get Converting circular structure to JSON error when init Client #365

Open wmt2023 opened 1 year ago

wmt2023 commented 1 year ago

Please use the following template to submit your issue. Following this template will allow us to quickly investigate and help you with your issue. Please be aware that issues which do not conform to this template may be closed.

For feature requests please contact us at team@intercom.io

Version info

Expected behavior

init Client Obj

Actual behavior

Get error Converting circular structure to JSON --> starting at object with constructor 'Client' | property 'admins' -> object with constructor 'Admin' --- property 'client' closes the circle

Steps to reproduce

                this.client = new Client({
                  tokenAuth: {
                        token: process.env.INTERCOM_WEBHOOK_SECRET,
                  },
                    // apiKeyAuth: {
                    //     appId: process.env.INTERCOM_CLIENT_ID,
                    //     appApiKey: process.env.INTERCOM_CLIENT_SECRET,
                    // },
                })

Logs

Converting circular structure to JSON --> starting at object with constructor 'Client' | property 'admins' -> object with constructor 'Admin' --- property 'client' closes the circle

Thanks