Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(api-settings): correct API keys description text with link (#37118)

Chris Stocktond8b623a0d004
diff --git a/apps/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx b/apps/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx
index d6367fc2a7b..b869761e6d9 100644
--- a/apps/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx
+++ b/apps/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx
@@ -165,11 +165,41 @@ export const DisplayApiSettings = ({
}
onChange={() => {}}
descriptionText={
- x.tags === 'service_role'
- ? 'This key has the ability to bypass Row Level Security. Never share it publicly. If leaked, generate a new JWT secret immediately. ' +
- (showLegacyText ? 'Prefer using Publishable API keys instead.' : '')
- : 'This key is safe to use in a browser if you have enabled Row Level Security for your tables and configured policies. ' +
- (showLegacyText ? 'Prefer using Secret API keys instead.' : '')
+ x.tags === 'service_role' ? (
+ <>
+ This key has the ability to bypass Row Level Security. Never share it
+ publicly. If leaked, generate a new JWT secret immediately.{' '}
+ {showLegacyText && (
+ <span>
+ Prefer using{' '}
+ <a
+ href={`/project/${projectRef}/settings/api-keys/new`}
+ className="text-link underline"
+ >
+ Secret API keys
+ </a>{' '}
+ instead.
+ </span>
+ )}
+ </>
+ ) : (
+ <>
+ This key is safe to use in a browser if you have enabled Row Level Security
+ for your tables and configured policies.{' '}
+ {showLegacyText && (
+ <span>
+ Prefer using{' '}
+ <a
+ href={`/project/${projectRef}/settings/api-keys/new`}
+ className="text-link underline"
+ >
+ Publishable API keys
+ </a>{' '}
+ instead.
+ </span>
+ )}
+ </>
+ )
}
/>