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().initOtpAuth({ otpType: "<string> (Whether to send OTP via SMS, email, or WhatsApp. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL, OTP_TYPE_WHATSAPP)", contact: "<string> (Email or phone number to send the OTP code to)", otpLength: 0 // Optional length of the OTP code. Default = 9, appName: "<string> (The name of the application. This field is required and will be used in email notifications if an email template is not provided.)", emailCustomization: { // emailCustomization field, logoUrl: "<string> (A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.)", magicLinkTemplate: "<string> (A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`.)", templateVariables: "<string> (JSON object containing key/value pairs to be used with custom templates.)", templateId: "<string> (Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template.)", }, smsCustomization: { // smsCustomization field, template: "<string> (Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}})", }, userIdentifier: "<string> (Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.)", sendFromEmailAddress: "<string> (Optional custom email address from which to send the OTP email)", alphanumeric: true // Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true, sendFromEmailSenderName: "<string> (Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications')", expirationSeconds: "<string> (Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes))", replyToEmailAddress: "<string> (Optional custom email address to use as reply-to)"});
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().initOtpAuth({ otpType: "<string> (Whether to send OTP via SMS, email, or WhatsApp. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL, OTP_TYPE_WHATSAPP)", contact: "<string> (Email or phone number to send the OTP code to)", otpLength: 0 // Optional length of the OTP code. Default = 9, appName: "<string> (The name of the application. This field is required and will be used in email notifications if an email template is not provided.)", emailCustomization: { // emailCustomization field, logoUrl: "<string> (A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.)", magicLinkTemplate: "<string> (A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`.)", templateVariables: "<string> (JSON object containing key/value pairs to be used with custom templates.)", templateId: "<string> (Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template.)", }, smsCustomization: { // smsCustomization field, template: "<string> (Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}})", }, userIdentifier: "<string> (Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.)", sendFromEmailAddress: "<string> (Optional custom email address from which to send the OTP email)", alphanumeric: true // Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true, sendFromEmailSenderName: "<string> (Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications')", expirationSeconds: "<string> (Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes))", replyToEmailAddress: "<string> (Optional custom email address to use as reply-to)"});
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().initOtpAuth({ otpType: "<string> (Whether to send OTP via SMS, email, or WhatsApp. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL, OTP_TYPE_WHATSAPP)", contact: "<string> (Email or phone number to send the OTP code to)", otpLength: 0 // Optional length of the OTP code. Default = 9, appName: "<string> (The name of the application. This field is required and will be used in email notifications if an email template is not provided.)", emailCustomization: { // emailCustomization field, logoUrl: "<string> (A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.)", magicLinkTemplate: "<string> (A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`.)", templateVariables: "<string> (JSON object containing key/value pairs to be used with custom templates.)", templateId: "<string> (Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template.)", }, smsCustomization: { // smsCustomization field, template: "<string> (Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}})", }, userIdentifier: "<string> (Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.)", sendFromEmailAddress: "<string> (Optional custom email address from which to send the OTP email)", alphanumeric: true // Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true, sendFromEmailSenderName: "<string> (Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications')", expirationSeconds: "<string> (Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes))", replyToEmailAddress: "<string> (Optional custom email address to use as reply-to)"});