Docs about user metadata question

from doc we can seee

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.

@HeroicNathan something to double check in the docs please.

Sorry for the late response, will check the docs soon and get back to you here.

@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).

1 Like