Reader sessions & device limits
A NewsTeam App can set a limit on reader sessions. Use published @newsteam/api@1.0.0-alpha.12 or the equivalent V1 JSON operations. Use the same app ID and API environment for sign-in, session management and retries. This is a reader access feature, not a limit on Desk logins.
Device-limit recovery
Section titled “Device-limit recovery”A reader can complete sign-in and receive a token even when the app’s limit is reached. An enforcing request, such as subscription.list, can then return API code DeviceLimitExceeded (DeviceLimitExceededError in the SDK). Keep the current token so the reader can manage sessions. Do not use a client-side count to decide whether the reader is blocked.
| V1 JSON POST operation | SDK call | Use |
|---|---|---|
subscription.list | api.subscription.list() | Read subscriptions or detect the device-limit error |
auth.list-devices | api.auth.listDevices() | List sessions available for management and identify the current one with isMe |
auth.revoke-access-token | api.auth.revokeAccessToken({ deviceId }) | End the selected session using its returned ID |
auth.me | api.auth.me() | Recheck whether the current reader token is still valid |
- Show a device-limit screen when the API reports the limit. Fetch the current session list and label the entry marked
isMeas This session. These are sign-ins, not necessarily distinct physical devices. - Let the reader choose a session to sign out. Use only an ID from the authenticated reader’s current session list. The list is not a count of sessions that apply to this app’s cap; display the API result as returned rather than inventing app filters. For ordinary sign-out,
auth.revokeAccessToken({})revokes the current session. - Retry the protected operation after removal. Continue only when the server permits it; if the limit is still enforced, refresh the list and keep the recovery screen open. A successful revoke response does not itself prove the current session is now eligible.
For raw requests use Authorization: Bearer YOUR_READER_TOKEN and app-id. For the SDK, use the reader’s accessToken option. Keep session responses private and uncached. On the web, run revocation through an authenticated, same-origin mutation handler; do not build a sign-out link that revokes on GET. Keep session metadata and credentials out of shared caches, public analytics and logs.
Revoked sessions
Section titled “Revoked sessions”A previously signed-in browser or app may still hold a token after that session was removed elsewhere. A private request can return AccessTokenNotFound or Unauthorized; use the documented response code or SDK error, not an HTTP status or message text alone. When a protected operation reports an auth error, recheck the existing token with an uncached auth.me before treating an ambiguous failure as a revoked session. An anonymous/public response can succeed without validating the reader token.
On confirmed rejection, clear the token and cached reader, subscription and entitlement state, then prompt the reader to sign in again. A short notice such as “This session was signed out. Sign in again to continue.” is enough. Do not sign readers out for a device-limit error, an unrelated access denial, or a temporary network or service failure.
Test before enabling a limit
Section titled “Test before enabling a limit”On a staging app with a test account and a limit of one, sign in twice. Confirm that the blocked sign-in can list sessions, knows which entry is current and can recover after removing the other one. On the removed session, verify its next private check clears the local sign-in state and shows the notice. Check a normal sign-out and a no-limit app as controls. If customers use web and native products, test the app IDs and sign-in flows they actually use.