Skip to content

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

[FE-1426] feat(studio): clerk fdw (#33803)

Alaister Young3d766bc1c110
diff --git a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx
index 883cb4224e4..76c8c71bf48 100644
--- a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx
+++ b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx
@@ -50,6 +50,13 @@ const pageMap = [
},
remoteFile: 'bigquery.md',
},
+ {
+ slug: 'clerk',
+ meta: {
+ title: 'Clerk',
+ },
+ remoteFile: 'clerk.md',
+ },
{
slug: 'clickhouse',
meta: {
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index 5f84fdb6c4b..bfc1249afdc 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -1091,6 +1091,10 @@ export const database: NavMenuConstant = {
name: 'Connecting to BigQuery',
url: '/guides/database/extensions/wrappers/bigquery',
},
+ {
+ name: 'Connecting to Clerk',
+ url: '/guides/database/extensions/wrappers/clerk',
+ },
{
name: 'Connecting to ClickHouse',
url: '/guides/database/extensions/wrappers/clickhouse',
diff --git a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
index 3acf2500059..014769ea3b3 100644
--- a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
+++ b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
@@ -4,10 +4,12 @@ import { useEffect, useState } from 'react'
import { toast } from 'sonner'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
+import { DocsButton } from 'components/ui/DocsButton'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { useDatabaseExtensionEnableMutation } from 'data/database-extensions/database-extension-enable-mutation'
import { useSchemasQuery } from 'data/database/schemas-query'
import { executeSql } from 'data/sql/execute-sql-query'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
@@ -20,8 +22,6 @@ import {
WarningIcon,
} from 'ui'
import { Admonition } from 'ui-patterns'
-import { DocsButton } from 'components/ui/DocsButton'
-import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
const orioleExtCallOuts = ['vector', 'postgis']
@@ -43,7 +43,7 @@ const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionM
})
const { mutate: enableExtension, isLoading: isEnabling } = useDatabaseExtensionEnableMutation({
onSuccess: () => {
- toast.success(`${extension.name} is on.`)
+ toast.success(`Extension "${extension.name}" is now enabled`)
onCancel()
},
onError: (error) => {
diff --git a/apps/studio/components/interfaces/Integrations/Wrappers/OverviewTab.tsx b/apps/studio/components/interfaces/Integrations/Wrappers/OverviewTab.tsx
index 6a0141d0ff5..8408082c045 100644
--- a/apps/studio/components/interfaces/Integrations/Wrappers/OverviewTab.tsx
+++ b/apps/studio/components/interfaces/Integrations/Wrappers/OverviewTab.tsx
@@ -45,8 +45,10 @@ export const WrapperOverviewTab = () => {
const isWrappersExtensionInstalled = !!wrappersExtension?.installed_version
const hasRequiredVersion =
(wrappersExtension?.installed_version ?? '') >= (wrapperMeta?.minimumExtensionVersion ?? '')
+ // [Joshen] Default version is what's on the DB, so if the installed version is already the default version
+ // but still doesnt meet the minimum extension version, then DB upgrade is required
const databaseNeedsUpgrading =
- wrappersExtension?.installed_version !== wrappersExtension?.default_version
+ wrappersExtension?.installed_version === wrappersExtension?.default_version
return (
<IntegrationOverviewTab
diff --git a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
index 150e7332875..4d6e25bdfe6 100644
--- a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
+++ b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
@@ -17,6 +17,7 @@ export const WRAPPER_HANDLERS = {
SNOWFLAKE: 'wasm_fdw_handler',
CAL: 'wasm_fdw_handler',
CALENDLY: 'wasm_fdw_handler',
+ CLERK: 'wasm_fdw_handler',
}
export const WRAPPERS: WrapperMeta[] = [
@@ -2530,4 +2531,344 @@ export const WRAPPERS: WrapperMeta[] = [
},
],
},
+ {
+ name: 'clerk_wrapper',
+ description: 'User Management Platform',
+ handlerName: WRAPPER_HANDLERS.CLERK,
+ validatorName: 'wasm_fdw_validator',
+ icon: `${BASE_PATH}/img/icons/clerk-icon.svg`,
+ label: 'Clerk',
+ extensionName: 'clerkFdw',
+ docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/clerk',
+ minimumExtensionVersion: '0.4.0',
+ server: {
+ options: [
+ {
+ name: 'fdw_package_url',
+ label: 'FDW Package URL',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue:
+ 'https://github.com/supabase/wrappers/releases/download/wasm_clerk_fdw_v0.1.0/clerk_fdw.wasm',
+ hidden: true,
+ },
+ {
+ name: 'fdw_package_name',
+ label: 'FDW Package Name',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: 'supabase:clerk-fdw',
+ hidden: true,
+ },
+ {
+ name: 'fdw_package_version',
+ label: 'FDW Package Version',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: '0.1.0',
+ hidden: true,
+ },
+ {
+ name: 'fdw_package_checksum',
+ label: 'FDW Package Checksum',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: '613be26b59fa4c074e0b93f0db617fcd7b468d4d02edece0b1f85fdb683ebdc4',
+ hidden: true,
+ },
+ {
+ name: 'api_url',
+ label: 'Clerk API URL',
+ required: false,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: 'https://api.clerk.com/v1',
+ },
+ {
+ name: 'api_key_id',
+ label: 'Clerk API Key',
+ required: true,
+ encrypted: true,
+ secureEntry: true,
+ },
+ ],
+ },
+ tables: [
+ {
+ label: 'Allow List',
+ description: 'List of all identifiers allowed to sign up to an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'invitation_id', type: 'text' },
+ { name: 'identifier', type: 'text' },
+ { name: 'identifier_type', type: 'text' },
+ { name: 'instance_id', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'allowlist_identifiers',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Block List',
+ description: 'List of all identifiers which are not allowed to access an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'identifier', type: 'text' },
+ { name: 'identifier_type', type: 'text' },
+ { name: 'instance_id', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'blocklist_identifiers',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Domains',
+ description: 'List of all domains for an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'name', type: 'text' },
+ { name: 'is_satellite', type: 'boolean' },
+ { name: 'frontend_api_url', type: 'text' },
+ { name: 'accounts_portal_url', type: 'text' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'domains',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Invitations',
+ description: 'List of all non-revoked invitations for your application',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'email_address', type: 'text' },
+ { name: 'url', type: 'text' },
+ { name: 'revoked', type: 'boolean' },
+ { name: 'status', type: 'text' },
+ { name: 'expires_at', type: 'timestamp' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'invitations',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'JWT Templates',
+ description: 'List of all JWT templates',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'name', type: 'text' },
+ { name: 'lifetime', type: 'bigint' },
+ { name: 'allowed_clock_skew', type: 'bigint' },
+ { name: 'custom_signing_key', type: 'boolean' },
+ { name: 'signing_algorithm', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'jwt_templates',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'OAuth Applications',
+ description: 'List of OAuth applications for an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'name', type: 'text' },
+ { name: 'instance_id', type: 'text' },
+ { name: 'client_id', type: 'text' },
+ { name: 'public', type: 'boolean' },
+ { name: 'scopes', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'oauth_applications',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Organizations',
+ description: 'List of organizations for an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'name', type: 'text' },
+ { name: 'slug', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'organizations',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Organization Invitations',
+ description: 'List of organization invitations for an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'email_address', type: 'text' },
+ { name: 'role', type: 'text' },
+ { name: 'role_name', type: 'text' },
+ { name: 'organization_id', type: 'text' },
+ { name: 'status', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'organization_invitations',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Organization Memberships',
+ description: 'List of organization user memberships for an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'role', type: 'text' },
+ { name: 'role_name', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'organization_memberships',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Redirect URLs',
+ description: 'List of all whitelisted redirect urls for the instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'url', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'redirect_urls',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'SAML Connections',
+ description: 'List of SAML Connections for an instance',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'name', type: 'text' },
+ { name: 'domain', type: 'text' },
+ { name: 'active', type: 'boolean' },
+ { name: 'provider', type: 'text' },
+ { name: 'user_count', type: 'bigint' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'saml_connections',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Users',
+ description: 'List of all users',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'external_id', type: 'text' },
+ { name: 'username', type: 'text' },
+ { name: 'first_name', type: 'text' },
+ { name: 'last_name', type: 'text' },
+ { name: 'created_at', type: 'timestamp' },
+ { name: 'updated_at', type: 'timestamp' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'users',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ ],
+ },
]