kinto.js icon indicating copy to clipboard operation
kinto.js copied to clipboard

Document how to use custom endpoints

Open leplatrem opened this issue 3 years ago • 0 comments

Users wondering if this is the correct way:

const client = new KintoClient(process.env.VUE_APP_API_URL)
const token = localStorage.getItem('token') ?? null
if (token) { client.setHeaders({ Authorization: `JWT ${token}` }) }
...
const path = endpoints.usermanual_info(uid)
client.execute({
      path,
      body: {
        data,
        permissions
      },
      method: 'POST',
      headers: client._headers
    })

leplatrem avatar Dec 15 '21 15:12 leplatrem