@@ -73,15 +73,18 @@ export async function createWebhook(
7373) : Promise < WebhookSingleResponse > {
7474 try {
7575 const authToken = await getAuthToken ( ) ;
76- const response = await fetch ( `${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks` , {
77- method : "POST" ,
78- headers : {
79- "Content-Type" : "application/json" ,
80- "x-client-id" : clientId ,
81- Authorization : `Bearer ${ authToken } ` ,
76+ const response = await fetch (
77+ `https://${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks` ,
78+ {
79+ method : "POST" ,
80+ headers : {
81+ "Content-Type" : "application/json" ,
82+ "x-client-id" : clientId ,
83+ Authorization : `Bearer ${ authToken } ` ,
84+ } ,
85+ body : JSON . stringify ( payload ) ,
8286 } ,
83- body : JSON . stringify ( payload ) ,
84- } ) ;
87+ ) ;
8588
8689 if ( ! response . ok ) {
8790 const errorText = await response . text ( ) ;
@@ -105,13 +108,16 @@ export async function getWebhooks(
105108) : Promise < WebhooksListResponse > {
106109 try {
107110 const authToken = await getAuthToken ( ) ;
108- const response = await fetch ( `${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks` , {
109- method : "GET" ,
110- headers : {
111- "x-client-id" : clientId ,
112- Authorization : `Bearer ${ authToken } ` ,
111+ const response = await fetch (
112+ `https://${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks` ,
113+ {
114+ method : "GET" ,
115+ headers : {
116+ "x-client-id" : clientId ,
117+ Authorization : `Bearer ${ authToken } ` ,
118+ } ,
113119 } ,
114- } ) ;
120+ ) ;
115121
116122 if ( ! response . ok ) {
117123 const errorText = await response . text ( ) ;
@@ -137,7 +143,7 @@ export async function deleteWebhook(
137143 try {
138144 const authToken = await getAuthToken ( ) ;
139145 const response = await fetch (
140- `${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks/${ encodeURIComponent ( webhookId ) } ` ,
146+ `https:// ${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks/${ encodeURIComponent ( webhookId ) } ` ,
141147 {
142148 method : "DELETE" ,
143149 headers : {
@@ -171,7 +177,7 @@ export async function testWebhook(
171177 try {
172178 const authToken = await getAuthToken ( ) ;
173179 const response = await fetch (
174- `${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks/test` ,
180+ `https:// ${ THIRDWEB_INSIGHT_API_DOMAIN } /v1/webhooks/test` ,
175181 {
176182 method : "POST" ,
177183 headers : {
0 commit comments