Skip to content

Commit 5d87b82

Browse files
authored
Merge pull request #616 from clerkinc/yourtallness/secret_key_support
feat(backend-core,backend): Support new secret key format in isDevelo…
2 parents 4e09dad + d7b787e commit 5d87b82

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/backend-core/src/util/clerkApiKey.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function isDevelopmentOrStaging(apiKey: string): boolean {
2-
return apiKey.startsWith('test_');
2+
return apiKey.startsWith('test_') || apiKey.startsWith('sk_test_');
33
}
44

55
export function isProduction(apiKey: string): boolean {

packages/backend/src/util/instance.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export function isDevelopmentFromApiKey(apiKey: string): boolean {
2-
return apiKey.startsWith('test_');
2+
return apiKey.startsWith('test_') || apiKey.startsWith('sk_test_');
33
}
44

55
export function isProductionFromApiKey(apiKey: string): boolean {
6-
return apiKey.startsWith('live_');
6+
return apiKey.startsWith('live_') || apiKey.startsWith('sk_live_');
77
}
88

99
export function isStaging(frontendApi: string): boolean {

0 commit comments

Comments
 (0)