Events
What Doshi tells your page, and when — as SDK callbacks and as iframe messages.
Doshi tells your page two things: that it is ready, and that the member cannot use it now. The SDK calls your callbacks, and the iframe posts messages to its parent. The rules are the same for both.
| Event | SDK | Iframe message |
|---|---|---|
| Ready | onReady() |
{ type: |
| Error | onError({ code, during }) |
{ type: |
The first screen has rendered. Swap out your own placeholder here. It fires once.
The member cannot use Doshi now. It fires once per code: a retry that fails again is
the same outage, and a second auth_expired would only make your page react twice.
code |
What it means | What to do |
|---|---|---|
unavailable |
Doshi could not load what it needs. | Offer “try again later”. |
auth_expired |
Your page stopped handing over tokens Doshi can use. Doshi has blanked its content. | Sign the member in again, then mount or load Doshi afresh, or remove it. See expiry. |
during says whether the member ever saw a screen:
during |
Meaning |
|---|---|
load |
The member never saw a Doshi screen. |
session |
The member had been using Doshi. |
That is what lets your page choose between “try again later” and “your session ended”.
While you integrate
Section titled “While you integrate”In Test, Doshi also tells you about mistakes on your page’s side. The frame and the SDK
print one console.warn line for each kind of mistake, prefixed Doshi: or
@doshi/sdk:. They warn only when the embed URL’s env or the token is Test, never in
Live, and there is nothing to turn on.
| Line | What your page did |
|---|---|
Doshi: … did not answer … within 10 seconds |
Sent no doshi: for a token request. |
Doshi: … answered … with token: null |
Answered null, so the member is signed out. |
Doshi: … quoting an id it did not ask with |
Answered without quoting the request’s id. |
Doshi: … from a window other than its parent |
Posted the answer from another window. |
Doshi: this frame is env=… |
Handed over a token from the other environment. |
@doshi/ getToken rejected |
getToken rejected after a Test token. If you rejected with a string, the line quotes it. |
@doshi/ the first token’s issuer … |
Handed over something that is not a Doshi member token. |
No line carries a token, anything about the member, or why we refused a token. Those refusals are on your console’s Rejected exchanges tab.