Developer
On this page

Activity API

Write entries to the user's activity log and audit log from your applet.

The ctx.sdk.activity surface writes an entry to the user’s activity log. Entries surface in the activity panel and the audit log.

Scope required: events:emit

Usage

Call ctx.sdk.activity.log inside a method’s run body:

import { defineMethod } from "@rightplace/applet-sdk/v2";

export default defineMethod({
  async run({ id }, ctx) {
    await ctx.sdk.activity.log("Subscribed to feed", {
      feedId: id,
      severity: "info",
    });
  },
});

The first argument is the human-readable message. The second argument is an optional details object: any fields you want recorded, plus an optional severity (“info”, and so on).

Notes

  • Declare events:emit in applet.json::scopes[] or the call is denied.
  • Entries appear in the user’s activity panel and the audit log, so write a clear, user-facing message.
  • Use this for user-facing mutations (create, update, delete, sync). Do not log noisy internal steps.
  • Returns a Promise; await it before the method returns.