Skip to content

React / Stripe / createPortalLink() with firebase v9

I’m using Stripe extension for Firebase with firebase functions. Since I refactored a bit my code for firebase v9 modular SDK, I’m getting the following console error with my Stripe createPortalLink() function:

Uncaught (in promise) TypeError: _firebase__WEBPACK_IMPORTED_MODULE_2__.default.functions is not a function
    at createPortalLink (Subscription.js:99:1)

Here is my function:

async function createPortalLink() {
    const functionRef = app

    const { data } = await functionRef({
      returnUrl: `${window.location.origin}/dashboard-pro/abonnement/`,
      locale: "auto",

Can anyone please advise?



You need to use the getFunctions() and httpsCallable() functions in the new Modular SDK as shown below:

import { getFunctions, httpsCallable } from "firebase/functions";

// after initializing Firebase
const functions = getFunctions();

const functionRef = httpsCallable(functions, 'ext-firestore-stripe-payments-createPortalLink');

    returnUrl: `${window.location.origin}/dashboard-pro/abonnement/`,
    locale: "auto",
  .then((result) => {
    const data =;

Checkout the documentation for more details.