import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().oauth2Authenticate({ oauth2CredentialId: "<string> (The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow)", authCode: "<string> (The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow)", redirectUri: "<string> (The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider)", codeVerifier: "<string> (The code verifier used by OAuth 2.0 PKCE providers)", nonce: "<string> (A nonce value set to sha256(publicKey), used to bind the OIDC token to a specific public key)", bearerTokenTargetPublicKey: "<string> (An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token)"});
import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().oauth2Authenticate({ oauth2CredentialId: "<string> (The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow)", authCode: "<string> (The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow)", redirectUri: "<string> (The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider)", codeVerifier: "<string> (The code verifier used by OAuth 2.0 PKCE providers)", nonce: "<string> (A nonce value set to sha256(publicKey), used to bind the OIDC token to a specific public key)", bearerTokenTargetPublicKey: "<string> (An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token)"});