Public Status Widget
We have added a public endpoint where you can access the status of your status
page. To access it, you only need the unique :slug
you have chosen for your
page.
The response is a JSON object with the following structure:
in which the status can be one of the following values:
How does it work?
The status is calculated by the ratio uptime / (uptime + downtime)
of the last
5 cron jobs of each monitor which we accumulate together. It is a simple
calculation that gives us a good overview of the status of your services.
We are caching the result for 30 seconds
to reduce the load on our database.
The Status.Incident
will always be returned when then status of any incident
on your page is not “monitoring” or “resolved”. You can attach an
incident to a monitor (implicit) or a page (explicit).
If you have a doubt about the above calculation, feel free to contact us via ping@openstatus.dev or discord.
React Widget
We currently do not provide any SDK or package to integrate the status into your stack. But will in the future.
If you are using Nextjs and RSC with the /app
directory, feel free to use that
Component. Small reminder that we are using shadcn ui and tailwindcss. You might
want to update the bg-muted
and text-foreground
classes to your needs.
We are using zod
to validate the response. You can use any other library if
you want or just remove it. But better be safe than sorry.
Then, import your StatusWidget.tsx
component to your layout as well as the slug prop to your specific monitor. Ideally, relative imports would be setup in your tsconfig.json
.
Astro Widget
Then, import your StatusWidget.astro
component as well as the slug from your specific monitor to your layout, most likely your footer. It would be better to have relative imports setup in your tsconfig.json.