@hellotext/hellotext
Version:
Hellotext JavaScript Client
27 lines (21 loc) • 506 B
JavaScript
import Hellotext from '../hellotext'
import { Configuration } from '../core'
class AcksAPI {
static get endpoint() {
return Configuration.endpoint('public/acks')
}
static async send(params = {}) {
const payload = {
...params,
session: Hellotext.session,
at: new Date().toISOString(),
}
fetch(this.endpoint, {
method: 'POST',
headers: Hellotext.headers,
body: JSON.stringify(payload),
keepalive: true,
})
}
}
export default AcksAPI