apps/hyperlocalise-web (/api/oauth/sanity/*, /api/integrations/sanity/*) and the plugin in apps/sanity-studio-plugin. End-user workflow is in Localize Sanity Studio documents.
Flow
- An editor chooses Connect Hyperlocalise in the Hyperlocalise editor view or bulk tool.
- The plugin opens
{ORIGIN}/api/oauth/sanity/authorizewith PKCE andstudio_origin={window.location.origin}. - Hyperlocalise signs the user in with WorkOS if needed, then shows consent at
/en/connect/sanity/oauthto pick a workspace Sanity Studio plugin connection. - The callback completes the handoff at
{ORIGIN}/connect/sanity/oauth/callback→/api/oauth/sanity/handoff/complete. - The plugin stores access and refresh tokens and calls
/api/integrations/sanity/*with headerX-Hyperlocalise-Access-Token. - Integration routes verify that the request
Originmatches the token’s storedstudio_origin.
OAuth endpoints
Replace{ORIGIN} with the public Hyperlocalise web origin (no trailing slash).
Redirect URI used by the plugin:
{ORIGIN}/connect/sanity/oauth/callback
Environment variables
apps/hyperlocalise-web
Local
.env can omit SANITY_OAUTH_CLIENT_ID; /api/integrations/sanity/health reports sanityOauthConfigured: false until it is set.
apps/sanity-studio-plugin
Build with HYPERLOCALISE_APP_URL when the default http://localhost:3000 is wrong for your Studio users. The plugin reads the app URL from settings storage per Sanity project and dataset.
Package and CI
- Source:
apps/sanity-studio-plugin(npm namesanity-plugin-hyperlocalise). - CI:
.github/workflows/sanity-studio-plugin.yml. - Publish: tag
sanity-studio-plugin-v*triggers.github/workflows/sanity-studio-plugin-publish.yml.
docs/adr/2026-10-20-sanity-studio-plugin-inspector.md.
