@@ -100,6 +100,25 @@ const idapiOrOAuthHeaders = ({
100
100
}
101
101
} ;
102
102
103
+ /**
104
+ * Prepares the options object for a fetch request to IDAPI
105
+ * or Avatar API (AAPI).
106
+ *
107
+ * @param options - The options object to prepare
108
+ * @param options.sendAuthHeader - Whether to send the access token or IDAPI cookies
109
+ * in the request
110
+ * @param options.useOkta - Whether to use Okta for authentication
111
+ * @param options.path - The path to the IDAPI endpoint (e.g. '/user/me')
112
+ * @param options.subdomain - The subdomain of the IDAPI endpoint
113
+ * (e.g. 'idapi' or 'avatar')
114
+ * @param options.method - The HTTP method to use
115
+ * @param options.cookies - The cookies coming from the client. These are used to
116
+ * build the security and cookie headers in the request
117
+ * @param options.signedCookies - The signed cookies coming from the client, also
118
+ * used to build the security and cookie headers in the request
119
+ * @param options.config - The IDAPI configuration object
120
+ * @returns The options object for the fetch request
121
+ */
103
122
export const setOptions = ( {
104
123
sendAuthHeader,
105
124
useOkta,
@@ -170,6 +189,8 @@ export const idapiFetch = async <T>({
170
189
* @param url The IDAPI endpoint to hit
171
190
* @param method The HTTP method to use (default: 'GET')
172
191
* @param processData A function to process the JSON response (optional)
192
+ * @param sendAuthHeader Whether to send the access token or IDAPI cookies
193
+ * in the request (default: false)
173
194
* @returns An Express route handler
174
195
*/
175
196
export const idapiProxyHandler =
0 commit comments