diff --git a/.changeset/long-icons-share.md b/.changeset/long-icons-share.md new file mode 100644 index 00000000000..24adca8d9ec --- /dev/null +++ b/.changeset/long-icons-share.md @@ -0,0 +1,9 @@ +--- +'gatsby-plugin-clerk': major +--- + +Drop deprecations. Migration steps: +- use `CLERK_SECRET_KEY` instead of `CLERK_API_KEY` env variable +- use `secretKey` instead of `apiKey` +- use `GATSBY_CLERK_PUBLISHABLE_KEY` instead of `GATSBY_CLERK_FRONTEND_API` env variable +- use `publishableKey` instead of `frontendApi` \ No newline at end of file diff --git a/packages/gatsby-plugin-clerk/src/constants.ts b/packages/gatsby-plugin-clerk/src/constants.ts index 4e8e2abf1f9..c736e8e0fcf 100644 --- a/packages/gatsby-plugin-clerk/src/constants.ts +++ b/packages/gatsby-plugin-clerk/src/constants.ts @@ -1,22 +1,6 @@ -import { deprecated } from '@clerk/shared/deprecated'; - export const API_URL = process.env.CLERK_API_URL || 'https://api.clerk.com'; export const API_VERSION = process.env.CLERK_API_VERSION || 'v1'; -/** - * @deprecated Use `CLERK_SECRET_KEY` instead. - */ -export const API_KEY = process.env.CLERK_API_KEY || ''; -if (API_KEY) { - deprecated('CLERK_API_KEY', 'Use `CLERK_SECRET_KEY` environment variable instead.'); -} export const SECRET_KEY = process.env.CLERK_SECRET_KEY || ''; -/** - * @deprecated Use `PUBLISHABLE_KEY` instead. - */ -export const FRONTEND_API = process.env.GATSBY_CLERK_FRONTEND_API || ''; -if (FRONTEND_API) { - deprecated('FRONTEND_API', 'Use `PUBLISHABLE_KEY` environment variable instead.'); -} export const PUBLISHABLE_KEY = process.env.GATSBY_CLERK_PUBLISHABLE_KEY || ''; export const CLERK_JS = process.env.GATSBY_CLERK_JS; diff --git a/packages/gatsby-plugin-clerk/src/gatsby-browser.tsx b/packages/gatsby-plugin-clerk/src/gatsby-browser.tsx index 470fd88d2ec..0e5cbdafdb6 100644 --- a/packages/gatsby-plugin-clerk/src/gatsby-browser.tsx +++ b/packages/gatsby-plugin-clerk/src/gatsby-browser.tsx @@ -1,8 +1,7 @@ -/* eslint-disable turbo/no-undeclared-env-vars */ import type { GatsbyBrowser } from 'gatsby'; import React from 'react'; -import { CLERK_JS, FRONTEND_API, PROXY_URL, PUBLISHABLE_KEY } from './constants'; +import { CLERK_JS, PROXY_URL, PUBLISHABLE_KEY } from './constants'; import { ClerkProvider } from './GatsbyClerkProvider'; export const wrapPageElement: GatsbyBrowser['wrapPageElement'] = ({ element, props }, pluginOptions) => { @@ -13,9 +12,7 @@ export const wrapPageElement: GatsbyBrowser['wrapPageElement'] = ({ element, pro } return ( - // @ts-expect-error { @@ -13,9 +12,7 @@ export const wrapPageElement: GatsbySSR['wrapPageElement'] = ({ element, props } } return ( - // @ts-expect-error { const headers = new Headers(Object.fromEntries(context.headers) as Record); @@ -38,7 +36,7 @@ const returnReferrerAsXForwardedHostToFixLocalDevGatsbyProxy = (headers: Map