-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tanstack-start): Export @clerk/backend from server subpath (#4128)
Co-authored-by: panteliselef <panteliselef@outlook.com>
- Loading branch information
1 parent
da01be9
commit 0fd784f
Showing
6 changed files
with
85 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@clerk/tanstack-start": minor | ||
--- | ||
|
||
Introducing `clerkClient()` from `@clerk/tanstack-start/server` for accessing the `@clerk/backend` client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createClerkClient } from '@clerk/backend'; | ||
|
||
import { | ||
API_URL, | ||
API_VERSION, | ||
DOMAIN, | ||
IS_SATELLITE, | ||
PROXY_URL, | ||
PUBLISHABLE_KEY, | ||
SDK_METADATA, | ||
SECRET_KEY, | ||
TELEMETRY_DEBUG, | ||
TELEMETRY_DISABLED, | ||
} from './constants'; | ||
|
||
const clerkClient: typeof createClerkClient = options => | ||
createClerkClient({ | ||
secretKey: SECRET_KEY, | ||
publishableKey: PUBLISHABLE_KEY, | ||
apiUrl: API_URL, | ||
apiVersion: API_VERSION, | ||
userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`, | ||
proxyUrl: PROXY_URL, | ||
domain: DOMAIN, | ||
isSatellite: IS_SATELLITE, | ||
sdkMetadata: SDK_METADATA, | ||
telemetry: { | ||
disabled: TELEMETRY_DISABLED, | ||
debug: TELEMETRY_DEBUG, | ||
}, | ||
...options, | ||
}); | ||
|
||
export { clerkClient }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { apiUrlFromPublishableKey } from '@clerk/shared/apiUrlFromPublishableKey'; | ||
|
||
import { getEnvVariable, getPublicEnvVariables } from '../utils/env'; | ||
|
||
export const CLERK_JS_VERSION = getPublicEnvVariables().clerkJsVersion || ''; | ||
export const CLERK_JS_URL = getPublicEnvVariables().clerkJsUrl || ''; | ||
export const API_VERSION = getEnvVariable('CLERK_API_VERSION') || 'v1'; | ||
export const SECRET_KEY = getEnvVariable('CLERK_SECRET_KEY') || ''; | ||
export const PUBLISHABLE_KEY = getPublicEnvVariables().publishableKey || ''; | ||
export const ENCRYPTION_KEY = getEnvVariable('CLERK_ENCRYPTION_KEY') || ''; | ||
export const API_URL = getEnvVariable('CLERK_API_URL') || apiUrlFromPublishableKey(PUBLISHABLE_KEY); | ||
export const DOMAIN = getPublicEnvVariables().domain || ''; | ||
export const PROXY_URL = getPublicEnvVariables().proxyUrl || ''; | ||
export const CLERK_JWT_KEY = getEnvVariable('CLERK_JWT_KEY') || ''; | ||
export const IS_SATELLITE = getPublicEnvVariables().isSatellite || false; | ||
export const SIGN_IN_URL = getPublicEnvVariables().signInUrl || ''; | ||
export const SIGN_UP_URL = getPublicEnvVariables().signUpUrl || ''; | ||
export const SDK_METADATA = { | ||
name: PACKAGE_NAME, | ||
version: PACKAGE_VERSION, | ||
environment: getEnvVariable('NODE_ENV'), | ||
}; | ||
|
||
export const TELEMETRY_DISABLED = getPublicEnvVariables().telemetryDisabled; | ||
export const TELEMETRY_DEBUG = getPublicEnvVariables().telemetryDebug; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters