(apiKey, endpoint, method, data)
| 58 | } |
| 59 | |
| 60 | function makeCustifyRequest(apiKey, endpoint, method, data) { |
| 61 | const custifyUrl = 'https://api.custify.com' |
| 62 | |
| 63 | return fetch(`${custifyUrl}/${endpoint}`, { |
| 64 | method, |
| 65 | headers: { |
| 66 | "Content-Type": "application/json", |
| 67 | 'Authorization': `Bearer ${apiKey}`, |
| 68 | }, |
| 69 | body: JSON.stringify(data), |
| 70 | }); |
| 71 | } |
| 72 | |
| 73 | export default custifyPlugin |