user.metadata A slot for custom information for the user - only readable from the client.
may i ask how to understand only readable from the client.? seems like also readable in server runtime right? Because there is an example in the doc:
const account = nk.accountGetId(ctx.userId)
// Only do the following checks if the tournament id is `vip_only`
if (data.tournamentId != "vip_only") {
return data;
}
// Only continue with the Join Tournament if the actioning user is a vip
if (account.user.metadata["vip"]) {
return data;
}
seem like after get account on runtime, we can get the corresponding metadata.
@mengxin The docs will be updated shortly, it’s just a slight clarity issue with the wording. What this is meant to mean is that it is “read only” from the client, so they can’t modify the metadata. However, the server can both read and write.
Hope this clarification helps (and the updated docs should avoid this confusion in the future).