Open History to see the last commit
1import type { ExpoConfig } from "expo/config";
2
3import { loadRepoEnv } from "../../scripts/lib/public-config.ts";
4
5type AppVariant = "development" | "preview" | "production";
6
7const repoEnv = loadRepoEnv();
8Object.assign(process.env, repoEnv);
9
10const APP_VARIANT = resolveAppVariant(repoEnv.APP_VARIANT);
11
12const VARIANT_CONFIG: Record<
13 AppVariant,
14 {
15 readonly appName: string;
16 readonly scheme: string;
17 readonly iosIcon: string;
18 readonly iosBundleIdentifier: string;
19 readonly androidPackage: string;
20 readonly relyingParty?: string;
21 }
22> = {
23 development: {
24 appName: "T3 Code Dev",
25 scheme: "t3code-dev",
26 iosIcon: "./assets/icon-composer-dev.icon",
27 iosBundleIdentifier: "com.t3tools.t3code.dev",
28 androidPackage: "com.t3tools.t3code.dev",
29 relyingParty: "clerk.t3.codes",
30 },
31 preview: {
32 appName: "T3 Code Preview",
33 scheme: "t3code-preview",
34 iosIcon: "./assets/icon-composer-prod.icon",
35 iosBundleIdentifier: "com.t3tools.t3code.preview",
36 androidPackage: "com.t3tools.t3code.preview",
37 relyingParty: "clerk.t3.codes",
38 },
39 production: {
40 appName: "T3 Code",
41 scheme: "t3code",
42 iosIcon: "./assets/icon-composer-prod.icon",
43 iosBundleIdentifier: "com.t3tools.t3code",
44 androidPackage: "com.t3tools.t3code",
45 relyingParty: "clerk.t3.codes",
46 },
47};
48
49function resolveAppVariant(value: string | undefined): AppVariant {
50 switch (value) {
51 case "development":
52 case "preview":
53 case "production":
54 return value;
55 default:
56 return "production";
57 }
58}
59
60const variant = VARIANT_CONFIG[APP_VARIANT];
61
62const config: ExpoConfig = {
63 name: variant.appName,
64 slug: "t3-code",
65 platforms: ["ios", "android"],
66 scheme: variant.scheme,
67 version: "0.1.0",
68 runtimeVersion: {
69 policy: process.env.MOBILE_VERSION_POLICY ?? "appVersion",
70 },
71 orientation: "portrait",
72 icon: "./assets/icon.png",
73 userInterfaceStyle: "automatic",
74 updates: {
75 enabled: true,
76 url: "https://u.expo.dev/d763fcb8-d37c-41ea-a773-b54a0ab4a454",
77 checkAutomatically: "ON_LOAD",
78 fallbackToCacheTimeout: 0,
79 },
80 ios: {
81 icon: variant.iosIcon,
82 supportsTablet: true,
83 bundleIdentifier: variant.iosBundleIdentifier,
84 associatedDomains: [
85 `applinks:${variant.relyingParty}`,
86 `webcredentials:${variant.relyingParty}`,
87 ],
88 infoPlist: {
89 NSAppTransportSecurity: {
90 NSAllowsArbitraryLoads: true,
91 },
92 NSLocalNetworkUsageDescription:
93 "Allow T3 Code to connect to T3 Code servers on your local network or tailnet.",
94 ITSAppUsesNonExemptEncryption: false,
95 },
96 },
97 android: {
98 icon: "./assets/icon.png",
99 package: variant.androidPackage,
100 adaptiveIcon: {
101 backgroundColor: "#E6F4FE",
102 foregroundImage: "./assets/android-icon-foreground.png",
103 backgroundImage: "./assets/android-icon-background.png",
104 monochromeImage: "./assets/android-icon-monochrome.png",
105 },
106 predictiveBackGestureEnabled: false,
107 },
108 web: {
109 favicon: "./assets/favicon.png",
110 },
111 plugins: [
112 "expo-router",
113 "expo-font",
114 "expo-secure-store",
115 ["@clerk/expo", { theme: "./clerk-theme.json" }],
116 "expo-web-browser",
117 [
118 "expo-camera",
119 {
120 cameraPermission: "Allow T3 Code to access your camera so you can scan pairing QR codes.",
121 barcodeScannerEnabled: true,
122 },
123 ],
124 [
125 "expo-splash-screen",
126 {
127 image: "./assets/splash-icon.png",
128 resizeMode: "contain",
129 backgroundColor: "#ffffff",
130 imageWidth: 220,
131 dark: {
132 image: "./assets/splash-icon.png",
133 backgroundColor: "#0a0a0a",
134 },
135 },
136 ],
137 [
138 "expo-build-properties",
139 {
140 ios: {
141 deploymentTarget: "18.0",
142 // AppCheckCore 11.3+ includes Swift and needs module maps for these Objective-C dependencies.
143 extraPods: [
144 { name: "GoogleUtilities", modular_headers: true },
145 { name: "RecaptchaInterop", modular_headers: true },
146 ],
147 },
148 },
149 ],
150 [
151 "expo-widgets",
152 {
153 bundleIdentifier: `${variant.iosBundleIdentifier}.widgets`,
154 groupIdentifier: `group.${variant.iosBundleIdentifier}`,
155 enablePushNotifications: true,
156 widgets: [
157 {
158 name: "AgentActivity",
159 displayName: "Agent Activity",
160 description: "Shows the current state of active T3 Code agents.",
161 supportedFamilies: ["systemSmall", "systemMedium", "accessoryRectangular"],
162 },
163 ],
164 },
165 ],
166 "./plugins/withAndroidCleartextTraffic.cjs",
167 ],
168 extra: {
169 appVariant: APP_VARIANT,
170 relay: {
171 url: repoEnv.T3CODE_RELAY_URL ?? null,
172 },
173 clerk: {
174 publishableKey: repoEnv.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY ?? null,
175 jwtTemplate: repoEnv.EXPO_PUBLIC_CLERK_JWT_TEMPLATE ?? null,
176 },
177 observability: {
178 tracesUrl: repoEnv.EXPO_PUBLIC_OTLP_TRACES_URL ?? "https://api.axiom.co/v1/traces",
179 tracesDataset: repoEnv.EXPO_PUBLIC_OTLP_TRACES_DATASET ?? null,
180 tracesToken: repoEnv.EXPO_PUBLIC_OTLP_TRACES_TOKEN ?? null,
181 },
182 eas: {
183 projectId: "d763fcb8-d37c-41ea-a773-b54a0ab4a454",
184 },
185 },
186 owner: "pingdotgg",
187};
188
189export default config;