Developer

Projects API

List projects and read the current project via ctx.sdk.projects.

ctx.sdk.projects lists the projects in the workspace and reads the current project. It is a read-only discovery surface.

Scope required: projects:read

Usage

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

export default defineMethod("loadProjects", async (ctx) => {
  const projects = await ctx.sdk.projects.list();
  const current = await ctx.sdk.projects.getCurrent();      // { id, name, folderPath }
  return { projects, current };
});

Manifest

Declare the scope in applet.json:

{
  "scopes": ["projects:read"]
}

Notes

  • ctx.sdk.projects.list() returns every project in the workspace.
  • ctx.sdk.projects.getCurrent() returns the current project as { id, name, folderPath }.
  • This surface is read-only. It cannot create, update, or delete projects.