Giter VIP home page Giter VIP logo

Comments (10)

abramandis avatar abramandis commented on July 4, 2024 1

Hi, I am also having this issue even AFTER adding the proper code to the CLI, i.e. firebase functions:config:set stripe.token="..."

I also use
firebase functions:config:get
{
"stripe": {
"token": "my stripe secret api key"
}
}

EDIT-- Figured it out. There was syntax errors with my code. After this I received similar errors and had to npm install google logging and stripe

from functions-samples.

jamesdaniels avatar jamesdaniels commented on July 4, 2024

You will need to set your stripe token in the functions config. firebase functions:config:set stripe.token="..."

I'll be adding a Readme for this function today.

from functions-samples.

iThinkersTeam avatar iThinkersTeam commented on July 4, 2024

Thanks a lot

from functions-samples.

kvnapavl avatar kvnapavl commented on July 4, 2024

Will you please provide more detail on where to place firebase functions:config:set stripe.token="..."? Can this be added via command line?

Is the functions config either firebase.json or functions/index.js?

from functions-samples.

jamesdaniels avatar jamesdaniels commented on July 4, 2024

Yes, add it through the CLI https://firebase.google.com/docs/functions/config-env

from functions-samples.

kvnapavl avatar kvnapavl commented on July 4, 2024

Awesome. Thank you!

from functions-samples.

jakeseltz avatar jakeseltz commented on July 4, 2024

I'm continuing to get functions.config().stripe.token saying token not a variable of undefined

-- could that be related to my node version (Node.js v8.2.1 but Google Cloud Functions only supports v6.11.1)

I can hardcode my Stripe API Secret key directly into the function

const stripe = require('stripe')('XXXXcorrectkey')

If I look at my config, it looks fine - as my secret key is in there when I do the command:

firebase functions:config:get gives me

{
"stripe": {
"token": "XXXXcorrectkey"
}
}

I'm not sure what the issue is.. or if it really matters.. but I'd prefer the key be in config(). Any hints?

from functions-samples.

inlined avatar inlined commented on July 4, 2024

My best psychic debugging is that when you ran firebase functions:config:get it was on a test project and the error is coming from your production project (or vice versa).

Also make sure you are using the latest version of firebase-tools

from functions-samples.

prakis avatar prakis commented on July 4, 2024

I changed my nodejs version to old 6.11.5 and I started getting this error. I switched back to new Nodejs nodejs 8.9.1 the problem is fixed. It also works fine with nodejs 6.12.3.

from functions-samples.

AndersonHappens avatar AndersonHappens commented on July 4, 2024

Similar to prakis, I had the same issue but with node 10. Downgrading to node 8 (8.16.0) made it deploy just fine.

from functions-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.