userToken
to be provided in order to make calls. You’ll have to fetch this token via the GraphQL API (server-side) before passing it client-side.
userToken
) will be linked to one particular Kana User - meaning actions taken and data returned from the available methods will be tied only to that user.
We’ll walk through an example flow of how to obtain and provide this successfully below.
id
in Kana.
id
for a User is defined by you upon creation in Kana.userId
argument which maps to the id
for the User (as pulled earlier):
/kana/token
endpoint being hit.
On the client-side, we have the following function available which attempts to make a POST
request to the /kana/token
endpoint we setup earlier:
currentUser
as an argument. This is the one we have hard-coded but you would have pulled/stored from before - and we assume you do this client-side. If you instead do this server-side, then you can:body
of the Fetch API request
userToken
is now available client-side. Let’s pass it in as an argument to initialize the client.