+
+ {label} {isLoading && }
+
+
+ );
+ }
+);
+
+StripeCustomerPortalLink.displayName = "StripeCustomerPortalLink";
+
+export default StripeCustomerPortalLink;
diff --git a/frontend/src/components/hosted/types.ts b/frontend/src/components/hosted/types.ts
index 9d613fc..b8b17bd 100644
--- a/frontend/src/components/hosted/types.ts
+++ b/frontend/src/components/hosted/types.ts
@@ -6,3 +6,7 @@ export interface UserResponse {
subscriber_tier: string;
stripe_customer_id: string;
}
+
+export interface PortalSessionResponse {
+ url: string;
+}
diff --git a/frontend/src/components/hosted/useAuthenticatedFetch.ts b/frontend/src/components/hosted/useAuthenticatedFetch.ts
index 1abcaab..aabba72 100644
--- a/frontend/src/components/hosted/useAuthenticatedFetch.ts
+++ b/frontend/src/components/hosted/useAuthenticatedFetch.ts
@@ -2,6 +2,9 @@ import { useAuth } from "@clerk/clerk-react";
type FetchMethod = "GET" | "POST" | "PUT" | "DELETE";
+// Assumes that the backend is using JWTs for authentication
+// and assumes JSON responses
+// *If response code is not 200 OK or if there's any other error, throws an error
export const useAuthenticatedFetch = () => {
const { getToken } = useAuth();