@magicbell/core
Version:
Official MagicBell API wrapper
49 lines (48 loc) • 1.8 kB
TypeScript
export declare const api: any;
/**
* Performs a GET request.
*
* @param url - the server URL that will be used for the request
* @param params - the URL parameters to be sent with the request
*/
export declare function fetchAPI(url: string, params?: {}): any;
/**
* Performs a POST request.
*
* @param url - the server URL that will be used for the request
* @param data - the data to be sent as the request body
* @param params - the URL parameters to be sent with the request
*/
export declare function postAPI(url: string, data?: any, params?: {}): any;
/**
* Performs a DELETE request.
*
* @param url - the server URL that will be used for the request
* @param params - the URL parameters to be sent with the request
*/
export declare function deleteAPI(url: string, params?: {}): any;
/**
* Performs a PUT request.
*
* @param url - the server URL that will be used for the request
* @param data - the data to be sent as the request body
* @param params - the URL parameters to be sent with the request
*/
export declare function putAPI(url: string, data: any, params?: {}): any;
/**
* Sets the default headers for all requests.
*
* @param apiKey API key of your MagicBell project
* @param userEmail Email of the user whose notifications will be displayed
* @param userExternalId External ID of the user you want to fetch notifications for
* @param userKey Computed HMAC of the user whose notifications will be displayed, compute this with the secret of the magicbell project
* @param apiSecret API secret of your MagicBell project (required to create notifications)
*/
export declare function setupAjax(options: {
apiKey: string;
userEmail?: string;
userExternalId?: string;
userKey?: string;
apiSecret?: string;
baseURL?: string;
}): void;