Skip to content

Commit aaeb613

Browse files
fix: added custom api step
1 parent 2c4dff6 commit aaeb613

File tree

7 files changed

+92
-4
lines changed

7 files changed

+92
-4
lines changed

auth4genai/snippets/get-started/langchain-next-js/async-auth.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Prerequisites } from "/snippets/get-started/prerequisites/async-auth.jsx";
22
import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-app-steps.jsx";
33

4-
<Prerequisites />
4+
<Prerequisites createAuth0ApiStep={{}} />
55

66
### Prepare Next.js app
77

auth4genai/snippets/get-started/langchain-next-js/auth-for-rag.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Prerequisites } from "/snippets/get-started/prerequisites/auth-for-rag.jsx";
22
import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-app-steps.jsx";
33

4-
<Prerequisites />
4+
<Prerequisites createAuth0ApiStep={{}} />
55

66
### Prepare Next.js app
77

auth4genai/snippets/get-started/langchain-next-js/call-others-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Prerequisites } from "/snippets/get-started/prerequisites/call-others-api.jsx";
22
import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-app-steps.jsx";
33

4-
<Prerequisites />
4+
<Prerequisites createAuth0ApiStep={{}} createResourceServerClientStep={{}} />
55

66
<Tabs>
77
<Tab

auth4genai/snippets/get-started/langchain-next-js/call-your-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Prerequisites } from "/snippets/get-started/prerequisites/call-your-api.jsx";
22
import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-app-steps.jsx";
33

4-
<Prerequisites />
4+
<Prerequisites createAuth0ApiStep={{}} />
55

66
### Prepare Next.js app
77

auth4genai/snippets/get-started/prerequisites/async-auth.jsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,38 @@ import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-
33
export const Prerequisites = ({
44
callbackUrl = "http://localhost:3000/auth/callback",
55
logoutUrl = "http://localhost:3000",
6+
createAuth0ApiStep = undefined,
67
}) => {
78
const steps = AccountAndAppSteps({ callbackUrl, logoutUrl });
89

10+
if (createAuth0ApiStep) {
11+
steps.push(
12+
<Step key="auth0-api" title="Create an Auth0 API">
13+
<ul>
14+
<li>
15+
In your Auth0 Dashboard, go to{" "}
16+
<strong>Applications &gt; APIs</strong>.
17+
</li>
18+
<li>Create a new API with an identifier (audience).</li>
19+
<li>
20+
Once API is created, go to the APIs{" "}
21+
<strong>Settings &gt; Access Settings</strong> and enable{" "}
22+
<strong>Allow Offline Access</strong>.
23+
</li>
24+
<li>Note down the API identifier for your environment variables.</li>
25+
</ul>
26+
To learn more about Auth0 APIs, read{" "}
27+
<a
28+
href="https://auth0.com/docs/get-started/auth0-overview/set-up-apis"
29+
target="_blank"
30+
>
31+
APIs
32+
</a>
33+
.
34+
</Step>
35+
);
36+
}
37+
938
steps.push(
1039
<Step title="Enable CIBA Grant">
1140
Enable the CIBA Grant for your Auth0 Application. Go to{" "}

auth4genai/snippets/get-started/prerequisites/auth-for-rag.jsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,42 @@ export const Prerequisites = ({
44
callbackUrl = "http://localhost:3000/auth/callback",
55
logoutUrl = "http://localhost:3000",
66
appCreation = true,
7+
createAuth0ApiStep = undefined,
78
}) => {
89
const steps = [];
910

1011
if (appCreation) {
1112
steps.push(...AccountAndAppSteps({ callbackUrl, logoutUrl, appCreation }));
1213
}
1314

15+
if (createAuth0ApiStep) {
16+
steps.push(
17+
<Step key="auth0-api" title="Create an Auth0 API">
18+
<ul>
19+
<li>
20+
In your Auth0 Dashboard, go to{" "}
21+
<strong>Applications &gt; APIs</strong>.
22+
</li>
23+
<li>Create a new API with an identifier (audience).</li>
24+
<li>
25+
Once API is created, go to the APIs{" "}
26+
<strong>Settings &gt; Access Settings</strong> and enable{" "}
27+
<strong>Allow Offline Access</strong>.
28+
</li>
29+
<li>Note down the API identifier for your environment variables.</li>
30+
</ul>
31+
To learn more about Auth0 APIs, read{" "}
32+
<a
33+
href="https://auth0.com/docs/get-started/auth0-overview/set-up-apis"
34+
target="_blank"
35+
>
36+
APIs
37+
</a>
38+
.
39+
</Step>
40+
);
41+
}
42+
1443
steps.push(
1544
<Step title="Create an Auth0 FGA account">
1645
You need an{" "}

auth4genai/snippets/get-started/prerequisites/call-your-api.jsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,38 @@ import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-
33
export const Prerequisites = ({
44
callbackUrl = "http://localhost:3000/auth/callback",
55
logoutUrl = "http://localhost:3000",
6+
createAuth0ApiStep = undefined,
67
}) => {
78
const steps = AccountAndAppSteps({ callbackUrl, logoutUrl });
89

10+
if (createAuth0ApiStep) {
11+
steps.push(
12+
<Step key="auth0-api" title="Create an Auth0 API">
13+
<ul>
14+
<li>
15+
In your Auth0 Dashboard, go to{" "}
16+
<strong>Applications &gt; APIs</strong>.
17+
</li>
18+
<li>Create a new API with an identifier (audience).</li>
19+
<li>
20+
Once API is created, go to the APIs{" "}
21+
<strong>Settings &gt; Access Settings</strong> and enable{" "}
22+
<strong>Allow Offline Access</strong>.
23+
</li>
24+
<li>Note down the API identifier for your environment variables.</li>
25+
</ul>
26+
To learn more about Auth0 APIs, read{" "}
27+
<a
28+
href="https://auth0.com/docs/get-started/auth0-overview/set-up-apis"
29+
target="_blank"
30+
>
31+
APIs
32+
</a>
33+
.
34+
</Step>
35+
);
36+
}
37+
938
steps.push(
1039
<Step title="OpenAI Platform">
1140
Set up an{" "}
@@ -18,6 +47,7 @@ export const Prerequisites = ({
1847
.
1948
</Step>
2049
);
50+
2151
return (
2252
<>
2353
<Heading level={3} id="prerequisites">

0 commit comments

Comments
 (0)