(accessToken: string | undefined)
| 13 | |
| 14 | /** Build the shared Bearer auth headers for the WhatsApp Cloud API. */ |
| 15 | export function buildAuthHeaders(accessToken: string | undefined): Record<string, string> { |
| 16 | if (!accessToken) { |
| 17 | throw new Error('WhatsApp Access Token is required') |
| 18 | } |
| 19 | return { |
| 20 | Authorization: `Bearer ${accessToken.trim()}`, |
| 21 | 'Content-Type': 'application/json', |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | export function isRecord(value: unknown): value is Record<string, unknown> { |
| 26 | return typeof value === 'object' && value !== null |
no outgoing calls
no test coverage detected