@@ -37,22 +37,10 @@ export type ApiClient = ReturnType<typeof createBackendApiClient>;
37
37
export function createBackendApiClient ( options : CreateBackendApiOptions ) {
38
38
const request = buildRequest ( options ) ;
39
39
40
- return {
41
- __experimental_accountlessApplications : new AccountlessApplicationAPI (
42
- buildRequest ( { ...options , requireSecretKey : false } ) ,
43
- ) ,
44
- actorTokens : new ActorTokenAPI ( request ) ,
45
- allowlistIdentifiers : new AllowlistIdentifierAPI ( request ) ,
46
- betaFeatures : new BetaFeaturesAPI ( request ) ,
47
- blocklistIdentifiers : new BlocklistIdentifierAPI ( request ) ,
48
- clients : new ClientAPI ( request ) ,
49
- domains : new DomainAPI ( request ) ,
50
- emailAddresses : new EmailAddressAPI ( request ) ,
51
- instance : new InstanceAPI ( request ) ,
52
- invitations : new InvitationAPI ( request ) ,
53
- // Using "/" instead of an actual version since they're bapi-proxy endpoints.
54
- // bapi-proxy connects directly to C1 without URL versioning,
55
- // while API versioning is handled through the Clerk-API-Version header.
40
+ // Using "/" instead of an actual version since they're bapi-proxy endpoints.
41
+ // bapi-proxy connects directly to C1 without URL versioning,
42
+ // while API versioning is handled through the Clerk-API-Version header.
43
+ const bapiProxyMethods = {
56
44
machineTokens : new MachineTokensApi (
57
45
buildRequest ( {
58
46
...options ,
@@ -72,6 +60,21 @@ export function createBackendApiClient(options: CreateBackendApiOptions) {
72
60
apiVersion : '/' ,
73
61
} ) ,
74
62
) ,
63
+ } ;
64
+
65
+ return {
66
+ __experimental_accountlessApplications : new AccountlessApplicationAPI (
67
+ buildRequest ( { ...options , requireSecretKey : false } ) ,
68
+ ) ,
69
+ actorTokens : new ActorTokenAPI ( request ) ,
70
+ allowlistIdentifiers : new AllowlistIdentifierAPI ( request ) ,
71
+ betaFeatures : new BetaFeaturesAPI ( request ) ,
72
+ blocklistIdentifiers : new BlocklistIdentifierAPI ( request ) ,
73
+ clients : new ClientAPI ( request ) ,
74
+ domains : new DomainAPI ( request ) ,
75
+ emailAddresses : new EmailAddressAPI ( request ) ,
76
+ instance : new InstanceAPI ( request ) ,
77
+ invitations : new InvitationAPI ( request ) ,
75
78
jwks : new JwksAPI ( request ) ,
76
79
jwtTemplates : new JwtTemplatesApi ( request ) ,
77
80
oauthApplications : new OAuthApplicationsApi ( request ) ,
@@ -87,5 +90,6 @@ export function createBackendApiClient(options: CreateBackendApiOptions) {
87
90
users : new UserAPI ( request ) ,
88
91
waitlistEntries : new WaitlistEntryAPI ( request ) ,
89
92
webhooks : new WebhookAPI ( request ) ,
93
+ ...bapiProxyMethods ,
90
94
} ;
91
95
}
0 commit comments