Display Netlify's status badge in Sanity Studio and your site's recent deploys. Plus, trigger a new build if you want to!
sanity install netlify-deploy-status-badge
The plugin can be configured through <your-studio-folder>/config/netlify-deploy-status-badge.json
:
{
"apiId": "<YOUR-NETLIFY-API-OR-SITE-ID-HERE>"
}
By default, Netlify opensource projects are set to public and API access to the site and deploy logs don't need authentication. But still you want to authenticate for you to be able to trigger a new build on your site. There are two ways to authenticate, OAuth or personal tokens.
With personal tokens, anyone who has access to your Sanity Studio can do administrative actions on your behalf such as trigger a new build, etc. while with OAuth2, anyone who has access to your Sanity Studio will need to login and authorize with their Netlify account to do the former actions mentioned.
To configure OAuth2, go to your User Settings > Applications > OAuth. Click New OAuth application
. Fill out the following:
- Application Name -
Sanity Plugin Netlify Deploy Status Badge
or any name you prefer. - Redirect URI -
<YOUR_SANITY_STUDIO_URL>/netlify-deploy-status-badge
(eg: https://dorelljames.sanity.studio/netlify-deploy-status-badge) - Click Save and copy generated Client ID.
- Open
netlify-deploy-status-badge.json
and add the following like this below:
{
"apiId": "537d0d4d-3443-4cf7-b838-fe0478131e18",
"auth": {
"oauthClientId": "<COPIED_OAUTH_CLIENT_ID>"
}
}
- Voila! Done.
- Handle site 404 on App
- Support for using personal tokens to authenticate.
MIT © Dorell James See LICENSE