Reader type

user_type labels every question with the kind of reader who asked it: a signed-out visitor, a registered reader, a subscriber, or your own staff.

Miso uses the label for two things:

  • Entitlements. Each type maps to a tier, and the tier decides how many answers the reader gets. See Metering & Entitlements.
  • The record. The label is stored with the question, so your own reporting can separate the groups later.

Set it in the browser

user_type lives on the client context, beside the reader's id:

const misocmd = window.misocmd || (window.misocmd = []);
misocmd.push(async () => {
  const client = new MisoClient('YOUR_PUBLISHABLE_KEY');

  client.context.user_id = 'u-10293';        // your own stable id
  client.context.user_type = 'subscriber';

  await client.ui.ready;
});

Set it as early as you know it, and before the first question. Every later question carries it.

When a reader signs in or out during the visit, assign the new values. The next request picks them up:

client.context.user_id = 'u-10293';
client.context.user_type = 'registered';

user_type needs user_id

CAUTION: a reader with only an anonymous_id sends no user_type. The SDK drops it. There is no error, and the question arrives unlabelled.

The two fields travel together, so set both:

client.context.anonymous_id = 'anon-abc';
client.context.user_type = 'internal';
// → { "anonymous_id": "anon-abc" }          user_type is gone

client.context.user_id = 'staff-42';
client.context.user_type = 'internal';
// → { "user_id": "staff-42", "user_type": "internal" }

A signed-out visitor is anonymous to Miso whatever you set, which is the right answer: you have no identity to label.

The values

Value Tier Use it for
anonymous anon A signed-out visitor.
registered reg A reader with an account and no subscription.
subscriber sub A paying reader.
internal sub Your own staff.
free reg The same as registered.
paid sub The same as subscriber.

The list is fixed. A value outside it is rejected.

internal carries subscriber entitlements. Your staff get the subscriber allowance, and their questions stay labelled internal. That is usually what you want: the team is not metered like a reader, and their questions stay recognisable in the record.

Where it applies

user_type rides along on the answer endpoints: questions, hybrid search and summaries.

It is removed from search and recommendation requests. Those endpoints rank by behaviour rather than by tier, so the label has no job there. This is automatic, and it is not a fault to debug.

Check it is working

Open the network panel and look at the body of a POST /v1/ask/questions:

{
  "user_id": "staff-42",
  "user_type": "internal",
  "question": "…"
}

If user_type is missing, check user_id first. That is the cause almost every time.

Next