CtrlK
BlogDocsLog inGet started
Tessl Logo

guydemo/pubnub-presence

Implement real-time presence tracking with PubNub

79

1.07x

Quality

67%

Does it follow best practices?

Impact

98%

1.07x

Average score across 5 eval scenarios

Overview
Skills
Evals
Files

task.mdevals/scenario-4/

Secured Presence with Access Manager

Context

You are building a chat application that uses PubNub Access Manager to control who can read and write to channels. The application has both chat channels (where users need to see who is online) and notification channels (where presence tracking is unnecessary).

Users have reported that after enabling Access Manager, the online user list stopped working -- no presence events are being received even though the presence feature is enabled in the Admin Portal.

Your task is to fix the access control setup so presence works correctly alongside security, while keeping the permission scope minimal.

Task

Write a server-side JavaScript function that grants a user the appropriate PubNub permissions for:

  1. Full participation in a chat channel (reading and writing messages)
  2. Receiving presence information for that chat channel
  3. Receiving notifications from a separate notifications channel (no presence needed)

Also write the corresponding client-side subscription code that subscribes to both channels but only enables presence where it is needed.

Expected Outputs

  • grant-permissions.js -- the server-side function to grant access
  • subscribe-with-presence.js -- the client-side subscription code

Install with Tessl CLI

npx tessl i guydemo/pubnub-presence@0.1.2

evals

SKILL.md

tile.json