/
_app.js
33 lines (31 loc) · 1.06 KB
/
_app.js
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
import "src/styles/stytch.css";
import Head from "next/head";
import { StytchProvider } from "@stytch/nextjs";
import { createStytchUIClient } from "@stytch/nextjs/ui";
// We initialize the Stytch client using our project's public token which can be found in the Stytch dashboard
const stytch = createStytchUIClient(
process.env.NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN
);
export default function App({ Component, pageProps }) {
return (
<>
<Head>
<title>Stytch Next.js Example</title>
<meta
name="description"
content="An example Next.js application using Stytch for authentication"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.svg" />
</Head>
{/* Wrap the application with StytchProvider to make the SDK available in children components */}
<StytchProvider stytch={stytch}>
<main>
<div className="container">
<Component {...pageProps} />
</div>
</main>
</StytchProvider>
</>
);
}