Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda