Skip to main content
Go to Latest
File
/// <reference types='./internal.d.ts' />
export class Webhook { constructor(options: { url: string, payload: Record<string, unknown>, secret?: string }) { window.__darkflare.waitUntil(fetch(options.url, { method: 'POST', headers: { ...(options.secret && { authorization: `bearer ${options.secret}` }), 'content-type': 'application/json; charset=utf-8' }, body: JSON.stringify(options.payload) })) }}