Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
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
      .functions("europe-west1")
      .httpsCallable("ext-firestore-stripe-payments-createPortalLink");

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

Can anyone please advise?

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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');

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

Checkout the documentation for more details.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!