@@ -6,14 +6,15 @@ import { createClient } from "../../../src/browser"
66
77const publicKey = process . env . NEXT_PUBLIC_PIPEDREAM_PROJECT_PUBLIC_KEY
88const frontendHost = process . env . NEXT_PUBLIC_PIPEDREAM_FRONTEND_HOST
9- const appSlug = process . env . NEXT_PUBLIC_PIPEDREAM_TEST_APP_ID
10-
11- if ( ! publicKey ) throw new Error ( "Missing NEXT_PUBLIC_PIPEDREAM_PROJECT_PUBLIC_KEY env var" )
12- if ( ! appSlug ) throw new Error ( "Missing NEXT_PUBLIC_PIPEDREAM_TEST_APP_ID env var" )
13-
14- const pd = createClient ( { publicKey, frontendHost } )
9+ const oauthAppId = process . env . NEXT_PUBLIC_PIPEDREAM_TEST_APP_ID
10+ const appSlug = process . env . NEXT_PUBLIC_PIPEDREAM_APP_SLUG
1511
1612export default function Home ( ) {
13+ if ( ! publicKey ) throw new Error ( "Missing NEXT_PUBLIC_PIPEDREAM_PROJECT_PUBLIC_KEY env var" )
14+ if ( ! oauthAppId ) throw new Error ( "Missing NEXT_PUBLIC_PIPEDREAM_TEST_APP_ID env var" )
15+ if ( ! appSlug ) throw new Error ( "Missing NEXT_PUBLIC_PIPEDREAM_APP_SLUG env var" )
16+
17+ const pd = createClient ( { publicKey, frontendHost } )
1718 const [ externalUserId , setExternalUserId ] = useState < string | null > ( null )
1819 const [ githubData , setGithubData ] = useState < { login : string } | null > ( null )
1920 const [ token , setToken ] = useState < string | null > ( null )
@@ -34,8 +35,8 @@ export default function Home() {
3435 }
3536
3637 const connectAccount = async ( ) => {
37- if ( appSlug ) connectApp ( appSlug )
38- else console . error ( "Missing NEXT_PUBLIC_PIPEDREAM_TEST_APP_ID env var" )
38+ connectApp ( oauthAppId as string )
39+
3940 }
4041
4142 const signIn = ( ) => {
0 commit comments