forked from thejasonxie/private-github-link
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsst.config.ts
More file actions
46 lines (42 loc) · 1.16 KB
/
Copy pathsst.config.ts
File metadata and controls
46 lines (42 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export default $config({
app(input) {
return {
name: "private-github-link",
removal: input?.stage === "production" ? "retain" : "remove",
protect: ["production"].includes(input?.stage ?? ""),
home: "aws",
providers: {
aws: {
profile: "jasonxie-prod",
},
},
};
},
async run() {
const { domains } = await import("./domains.config");
// Sentry DSN secret for error tracking
const sentryDsn = new sst.Secret("SentryDsn");
// PostHog API key for analytics
const posthogApiKey = new sst.Secret("PosthogApiKey");
const isProduction = $app.stage === "production";
new sst.aws.TanStackStart("PrivateGithubLink", {
path: ".",
link: [sentryDsn, posthogApiKey],
domain: isProduction
? {
name: domains.app,
redirects: [`www.${domains.app}`],
aliases: [domains.landing, `www.${domains.landing}`],
}
: undefined,
environment: {
// Client-side Sentry DSN (VITE_ prefix exposes to browser)
VITE_SENTRY_DSN: sentryDsn.value,
// Server-side Sentry DSN
SENTRY_DSN: sentryDsn.value,
// PostHog API key for analytics (client-side)
VITE_POSTHOG_API_KEY: posthogApiKey.value,
},
});
},
});