@@ -6,14 +6,15 @@ import { createClient } from "../../../src/browser"
6
6
7
7
const publicKey = process . env . NEXT_PUBLIC_PIPEDREAM_PROJECT_PUBLIC_KEY
8
8
const 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
15
11
16
12
export 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 } )
17
18
const [ externalUserId , setExternalUserId ] = useState < string | null > ( null )
18
19
const [ githubData , setGithubData ] = useState < { login : string } | null > ( null )
19
20
const [ token , setToken ] = useState < string | null > ( null )
@@ -34,8 +35,8 @@ export default function Home() {
34
35
}
35
36
36
37
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
+
39
40
}
40
41
41
42
const signIn = ( ) => {
0 commit comments