@@ -70,18 +70,13 @@ export class Controller {
70
70
if ( this . adapter . streamContacts ) {
71
71
const {
72
72
PUBSUB_TOPIC_NAME : topicName ,
73
- PUBSUB_CONTACTS_CHANGED_TOPIC_NAME : contactsChangedTopicName ,
74
73
INTEGRATION_NAME : integrationName ,
75
74
} = process . env ;
76
75
77
76
if ( ! topicName ) {
78
77
throw new Error ( 'No PUBSUB_TOPIC_NAME provided.' ) ;
79
78
}
80
79
81
- if ( ! contactsChangedTopicName ) {
82
- throw new Error ( 'No PUBSUB_CONTACTS_CHANGED_TOPIC_NAME provided.' ) ;
83
- }
84
-
85
80
if ( ! integrationName ) {
86
81
throw new Error ( 'No INTEGRATION_NAME provided.' ) ;
87
82
}
@@ -92,6 +87,22 @@ export class Controller {
92
87
'Controller' ,
93
88
`Initialized PubSub client with topic ${ topicName } ` ,
94
89
) ;
90
+ }
91
+
92
+ if ( this . adapter . handleWebhook ) {
93
+ const {
94
+ PUBSUB_CONTACTS_CHANGED_TOPIC_NAME : contactsChangedTopicName ,
95
+ INTEGRATION_NAME : integrationName ,
96
+ } = process . env ;
97
+
98
+ if ( ! contactsChangedTopicName ) {
99
+ throw new Error ( 'No PUBSUB_CONTACTS_CHANGED_TOPIC_NAME provided.' ) ;
100
+ }
101
+
102
+ if ( ! integrationName ) {
103
+ throw new Error ( 'No INTEGRATION_NAME provided.' ) ;
104
+ }
105
+ this . integrationName = integrationName ;
95
106
96
107
this . pubSubContactsChangedClient = new PubSubContactChangeEventClient (
97
108
contactsChangedTopicName ,
0 commit comments