-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathliveblocks.server.config.ts
66 lines (52 loc) · 2.12 KB
/
liveblocks.server.config.ts
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Liveblocks API base url
import { getProviders } from "next-auth/react";
export const API_BASE_URL = "https://api.liveblocks.io";
// Your Liveblocks secret key
export const SECRET_API_KEY = process.env.LIVEBLOCKS_SECRET_KEY;
// ============================================================================
if (!SECRET_API_KEY) {
throw new Error(`You must add your Liveblocks secret key to .env.local to use the starter kit
Example .env.local file:
LIVEBLOCKS_SECRET_KEY=sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
You can find your secret keys on https://liveblocks.io/dashboard/apikeys
Follow the full starter kit guide on https://liveblocks.io/docs/guides/nextjs-starter-kit
`);
}
if (typeof window !== "undefined") {
console.log();
console.error(
"DANGER: You're using data from /liveblocks.server.config.ts on the client"
);
console.error("This may expose your secret key(s)");
console.log();
}
(async () => {
const providers = await getProviders();
if (providers?.github) {
if (!process.env.GITHUB_CLIENT_ID || !process.env.GITHUB_CLIENT_SECRET) {
console.log(`Your GitHub secrets are missing from .env.local
Example .env.local file:
GITHUB_CLIENT_ID=sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
GITHUB_CLIENT_SECRET=sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Follow the full starter kit guide to learn how to get them:
https://liveblocks.io/docs/guides/nextjs-starter-kit#github-authentication
`);
}
}
if (providers?.auth0) {
if (
!process.env.AUTH0_CLIENT_ID ||
!process.env.AUTH0_CLIENT_SECRET ||
!process.env.AUTH0_ISSUER_BASE_URL
) {
throw new Error(`Your Auth0 secrets are missing from .env.local
Example .env.local file:
AUTH0_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AUTH0_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AUTH0_ISSUER_BASE_URL=https://XXXXXXXXXXXXXXXXXX.com
Follow the full starter kit guide to learn how to get them:
https://liveblocks.io/docs/guides/nextjs-starter-kit#auth0-authentication
`);
}
}
})();