Skip to content

Commit ab10872

Browse files
committed
fix: move custom api prereq content to common
1 parent f8cf450 commit ab10872

File tree

9 files changed

+55
-148
lines changed

9 files changed

+55
-148
lines changed

auth4genai/how-tos/check-google-calendar-availability.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import NextJSAuth0Sample from "/snippets/how-tos/google-calendar/nextjs-auth0.md
1414
import GenKitSample from "/snippets/how-tos/google-calendar/genkit.mdx";
1515

1616
import { GoogleCalendarPrereqs } from "/snippets/how-tos/google-calendar/prereqs.jsx";
17+
import { CustomApiClient } from "/snippets/common/custom-api-client.jsx";
1718

1819
<Tabs>
1920
<Tab title="Javascript" icon="js">

auth4genai/how-tos/get-salesforce-opportunities.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ mode: "wide"
55
---
66

77
import { SalesforcePrereqs } from "/snippets/how-tos/salesforce/prereqs.jsx";
8+
import { CustomApiClient } from "/snippets/common/custom-api-client.jsx";
89

910
<Tabs>
1011
<Tab title="Next.js" icon="https://mintlify-assets.b-cdn.net/auth0/nextjs-svgrepo-com.svg">

auth4genai/how-tos/list-github-repositories.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import LlamaIndexJSSample from "/snippets/how-tos/github/llamaindex.mdx";
1515
import AccountLinking from "/snippets/how-tos/account-linking.mdx";
1616

1717
import { GitHubPrereqs } from "/snippets/how-tos/github/prereqs.jsx";
18+
import { CustomApiClient } from "/snippets/common/custom-api-client.jsx";
1819

1920
<Tabs>
2021
<Tab title="JavaScript" icon="js">

auth4genai/how-tos/list-slack-channels.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import GenKitSample from "/snippets/how-tos/slack/genkit.mdx";
1313
import LlamaIndexJSSample from "/snippets/how-tos/slack/llamaindex.mdx";
1414

1515
import { SlackPrereqs } from "/snippets/how-tos/slack/prereqs.jsx";
16+
import { CustomApiClient } from "/snippets/common/custom-api-client.jsx";
1617

1718
<Tabs>
1819
<Tab title="Javascript" icon="js">
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
export const CustomApiClient = ({
2+
apiName = "the external API"
3+
}) => {
4+
return (
5+
<Step title="Create a Custom API Client in Auth0">
6+
The Custom API Client allows your API server to perform token exchanges
7+
using{" "}
8+
<strong>
9+
<i>access tokens</i>
10+
</strong>{" "}
11+
instead of{" "}
12+
<strong>
13+
<i>refresh tokens</i>
14+
</strong>
15+
. This client enables Token Vault to exchange an access token for an
16+
external API access token (e.g., {apiName}).
17+
<br />
18+
<ul>
19+
<li>
20+
Navigate to <strong>Applications &gt; APIs</strong>
21+
</li>
22+
<li>
23+
Click the <strong>Create API</strong> button to create a new Custom
24+
API.
25+
</li>
26+
<li>
27+
Go to the Custom API you created and click the{" "}
28+
<strong>Add Application</strong> button in the right top corner.
29+
</li>
30+
<li>
31+
After that click the <strong>Configure Application</strong> button
32+
in the right top corner.
33+
</li>
34+
<li>
35+
Note down the <code>client id</code> and <code>client secret</code>{" "}
36+
for your environment variables.
37+
</li>
38+
</ul>
39+
</Step>
40+
);
41+
};
42+
43+

auth4genai/snippets/how-tos/github/prereqs.jsx

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -95,43 +95,8 @@ export const GitHubPrereqs = ({
9595
];
9696

9797
if (createCustomApiClientStep) {
98-
commonSteps.push(
99-
<Step title="Create a Custom API Client in Auth0">
100-
The Custom API Client allows your API server to perform token exchanges
101-
using{" "}
102-
<strong>
103-
<i>access tokens</i>
104-
</strong>{" "}
105-
instead of{" "}
106-
<strong>
107-
<i>refresh tokens</i>
108-
</strong>
109-
. This client enables Token Vault to exchange an access token for an
110-
external API access token (e.g., GitHub API).
111-
<br />
112-
<ul>
113-
<li>
114-
Navigate to <strong>Applications &gt; APIs</strong>
115-
</li>
116-
<li>
117-
Click the <strong>Create API</strong> button to create a new Custom
118-
API.
119-
</li>
120-
<li>
121-
Go to the Custom API you created and click the{" "}
122-
<strong>Add Application</strong> button in the right top corner.
123-
</li>
124-
<li>
125-
After that click the <strong>Configure Application</strong> button
126-
in the right top corner.
127-
</li>
128-
<li>
129-
Note down the <code>client id</code> and <code>client secret</code>{" "}
130-
for your environment variables.
131-
</li>
132-
</ul>
133-
</Step>
134-
);
98+
const step = CustomApiClient({ apiName: "Github API" });
99+
commonSteps.push(step);
135100
}
136101

137102
return (

auth4genai/snippets/how-tos/google-calendar/prereqs.jsx

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -99,43 +99,8 @@ export const GoogleCalendarPrereqs = ({
9999
];
100100

101101
if (createCustomApiClientStep) {
102-
commonSteps.push(
103-
<Step title="Create a Custom API Client in Auth0">
104-
The Custom API Client allows your API server to perform token exchanges
105-
using{" "}
106-
<strong>
107-
<i>access tokens</i>
108-
</strong>{" "}
109-
instead of{" "}
110-
<strong>
111-
<i>refresh tokens</i>
112-
</strong>
113-
. This client enables Token Vault to exchange an access token for an
114-
external API access token (e.g., Google Calendar API).
115-
<br />
116-
<ul>
117-
<li>
118-
Navigate to <strong>Applications &gt; APIs</strong>
119-
</li>
120-
<li>
121-
Click the <strong>Create API</strong> button to create a new Custom
122-
API.
123-
</li>
124-
<li>
125-
Go to the Custom API you created and click the{" "}
126-
<strong>Add Application</strong> button in the right top corner.
127-
</li>
128-
<li>
129-
After that click the <strong>Configure Application</strong> button
130-
in the right top corner.
131-
</li>
132-
<li>
133-
Note down the <code>client id</code> and <code>client secret</code>{" "}
134-
for your environment variables.
135-
</li>
136-
</ul>
137-
</Step>
138-
);
102+
const step = CustomApiClient({ apiName: "Google Calendar API" });
103+
commonSteps.push(step);
139104
}
140105

141106
return (

auth4genai/snippets/how-tos/salesforce/prereqs.jsx

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -123,43 +123,8 @@ export const SalesforcePrereqs = ({
123123
];
124124

125125
if (createCustomApiClientStep) {
126-
commonSteps.push(
127-
<Step title="Create a Custom API Client in Auth0">
128-
The Custom API Client allows your API server to perform token exchanges
129-
using{" "}
130-
<strong>
131-
<i>access tokens</i>
132-
</strong>{" "}
133-
instead of{" "}
134-
<strong>
135-
<i>refresh tokens</i>
136-
</strong>
137-
. This client enables Token Vault to exchange an access token for an
138-
external API access token (e.g., Salesforce API).
139-
<br />
140-
<ul>
141-
<li>
142-
Navigate to <strong>Applications &gt; APIs</strong>
143-
</li>
144-
<li>
145-
Click the <strong>Create API</strong> button to create a new Custom
146-
API.
147-
</li>
148-
<li>
149-
Go to the Custom API you created and click the{" "}
150-
<strong>Add Application</strong> button in the right top corner.
151-
</li>
152-
<li>
153-
After that click the <strong>Configure Application</strong> button
154-
in the right top corner.
155-
</li>
156-
<li>
157-
Note down the <code>client id</code> and <code>client secret</code>{" "}
158-
for your environment variables.
159-
</li>
160-
</ul>
161-
</Step>
162-
);
126+
const step = CustomApiClient({ apiName: "Salesforce API" });
127+
commonSteps.push(step);
163128
}
164129

165130
return (

auth4genai/snippets/how-tos/slack/prereqs.jsx

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -76,43 +76,8 @@ export const SlackPrereqs = ({
7676
];
7777

7878
if (createCustomApiClientStep) {
79-
commonSteps.push(
80-
<Step title="Create a Custom API Client in Auth0">
81-
The Custom API Client allows your API server to perform token exchanges
82-
using{" "}
83-
<strong>
84-
<i>access tokens</i>
85-
</strong>{" "}
86-
instead of{" "}
87-
<strong>
88-
<i>refresh tokens</i>
89-
</strong>
90-
. This client enables Token Vault to exchange an access token for an
91-
external API access token (e.g., Slack API).
92-
<br />
93-
<ul>
94-
<li>
95-
Navigate to <strong>Applications &gt; APIs</strong>
96-
</li>
97-
<li>
98-
Click the <strong>Create API</strong> button to create a new Custom
99-
API.
100-
</li>
101-
<li>
102-
Go to the Custom API you created and click the{" "}
103-
<strong>Add Application</strong> button in the right top corner.
104-
</li>
105-
<li>
106-
After that click the <strong>Configure Application</strong> button
107-
in the right top corner.
108-
</li>
109-
<li>
110-
Note down the <code>client id</code> and <code>client secret</code>{" "}
111-
for your environment variables.
112-
</li>
113-
</ul>
114-
</Step>
115-
);
79+
const step = CustomApiClient({ apiName: "Slack API" });
80+
commonSteps.push(step);
11681
}
11782

11883
return (

0 commit comments

Comments
 (0)