braze-api
Version:
Track users, send messages, export data, and more with Braze API.
26 lines • 818 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.track = track;
const request_1 = require("../common/request");
/**
* User track.
*
* Use this endpoint to record custom events, purchases, and update user profile attributes.
*
* {@link https://www.braze.com/docs/api/endpoints/user_data/post_user_track/}
*
* @param apiUrl - Braze REST endpoint.
* @param apiKey - Braze API key.
* @param body - Request parameters.
* @param bulk - Bulk update.
* @returns - Braze response.
*/
function track(apiUrl, apiKey, body, bulk) {
const options = (0, request_1.buildOptions)({ apiKey });
if (bulk) {
;
options.headers['X-Braze-Bulk'] = 'true';
}
return (0, request_1.post)(`${apiUrl}/users/track`, body, options);
}
//# sourceMappingURL=track.js.map