CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

pubnub/pubnub-functions

Develop serverless edge functions with PubNub Functions 2.0

Agent Success

Agent success rate when using this tile

93%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.79x

Baseline

Agent success rate without this tile

52%

Overview
Eval results
Skill reviews
Files

task.mdevals/scenario-1/

Message Enrichment Function for Chat Application

Context

You are building a PubNub Function that runs when messages are published to any chat channel. The function should look up the sender's profile from the key-value store and attach their display name and avatar URL to the message before it reaches subscribers. It should also add a server-side timestamp. If the user profile is not found, the message should still go through with default values.

Task

Write a PubNub Before Publish function (enrich-message.js) that:

  1. Reads the sender's profile from persistent storage using the userId in the message
  2. Adds the sender's display name and avatar to the message
  3. Adds a server-side ISO timestamp to the message
  4. Allows the message to proceed after enrichment
  5. Handles errors gracefully without blocking message delivery

Expected Outputs

  • An enrich-message.js file containing a complete PubNub Function ready for deployment.
tessl i pubnub/pubnub-functions@0.1.4

evals

scenario-1

rubric.json

task.md

SKILL.md

tile.json