add twilio FROM number
This commit is contained in:
parent
2201b078d5
commit
9451f5ceab
1 changed files with 6 additions and 2 deletions
|
|
@ -1,16 +1,19 @@
|
||||||
|
import { PhoneRegex } from '$lib/regex';
|
||||||
import { logger } from '$lib/server/logger';
|
import { logger } from '$lib/server/logger';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export interface TwilioConfiguration {
|
export interface TwilioConfiguration {
|
||||||
twilio_account_sid: string;
|
twilio_account_sid: string;
|
||||||
twilio_auth_token: string;
|
twilio_auth_token: string;
|
||||||
|
twilio_phone_number: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LoadConfig = (): TwilioConfiguration => {
|
const LoadConfig = (): TwilioConfiguration => {
|
||||||
const { success, data, error } = z
|
const { success, data, error } = z
|
||||||
.object({
|
.object({
|
||||||
VITE_TWILIO_ACCOUNT_SID: z.string(),
|
VITE_TWILIO_ACCOUNT_SID: z.string(),
|
||||||
VITE_TWILIO_AUTH_TOKEN: z.string()
|
VITE_TWILIO_AUTH_TOKEN: z.string(),
|
||||||
|
VITE_TWILIO_PHONE_NUMBER: z.string().regex(PhoneRegex),
|
||||||
})
|
})
|
||||||
.safeParse(import.meta.env);
|
.safeParse(import.meta.env);
|
||||||
|
|
||||||
|
|
@ -20,7 +23,8 @@ const LoadConfig = (): TwilioConfiguration => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
twilio_account_sid: data!.VITE_TWILIO_ACCOUNT_SID,
|
twilio_account_sid: data!.VITE_TWILIO_ACCOUNT_SID,
|
||||||
twilio_auth_token: data!.VITE_TWILIO_AUTH_TOKEN
|
twilio_auth_token: data!.VITE_TWILIO_AUTH_TOKEN,
|
||||||
|
twilio_phone_number: data!.VITE_TWILIO_PHONE_NUMBER,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue