Examplary
Start for free
Developer docs

Apps can show their status, start their own cron jobs and write audit logs

Three additions to @examplary/apps (1.5.0) for apps that do work in the background, like a roster sync. reportStatus() shows what your app last did on its card in the workspace, where admins see it in the app's settings. runCronJob(id) queues one of your app's own cron jobs for the current workspace, at most twice a minute: handy for a "Sync now" settings button that needs more than a hook's 25 seconds, or for a cron job that runs out of time and wants to carry on.

import { reportStatus, runCronJob } from "@examplary/apps";
 
await reportStatus({ state: "running", startedAt: new Date().toISOString() });
// ... out of time? Pick up where you left off in a fresh run.
await runCronJob("sync");
await reportStatus({ state: "success", summary: { studentsCreated: 12 } });

And an app with the audit-logs:write scope can now add its own entries with POST /audit-logs from a hook that runs without a user, such as a cron job. They show your app as the actor. More on scopes in calling the Examplary API.