Questions tagged [netlify-function]

Netlify functions is one of the services offered in the Netlify platform.

It uses AWS's serverless Lambda functions, but allows users to access them without an AWS account, and with management of the functions all done by Netlify. Netlify functions can be built with either JavaScript or Go.

Learn more about Netlify Functions and their abilities here.

115 questions
1
vote
1 answer

Netlify Serverless Function returning 404

I am trying to set up a simple serverless function on Netlify just to test out usage of environment variables. I have defined the following two environment variables in Netlify for my site: Variable…
SJB
  • 117
  • 1
  • 2
  • 11
1
vote
0 answers

Busboy Content-Type header is present but still getting an error saying missing Content-Type

I am using netlify functions to make an API. When the user submits multipart/form-data, I need to parse that data using busboy. But when I do this: const busboy = new Busboy({headers: event.headers}) I get an error saying missing content type. But…
1
vote
1 answer

Strange cookie behaviour in Netlify Functions

I'm seeing some strange cookie behaviour on a Gatsby site hosted on Netlify. In my Netlify Function, I sometimes receive cookies like this: "headers": { "cookie": "__stripe_mid=someId, nf_jwt=someId, __stripe_sid=someId", /* ... */ }, Instead…
shennan
  • 10,798
  • 5
  • 44
  • 79
1
vote
1 answer

Sanity.io API upload images from URL

Cross post from slack#help channel... I'm creating a Sanity/Nuxt site for a client that includes a blog component. His primary marketing source is Instagram and since Instagram's API only allows for single-image posts I'm trying to go about it in…
Jeff
  • 309
  • 4
  • 20
1
vote
1 answer

Netlify lambda function query string parameters are passed in different way between local environment and production environment

I created several lambda functions and deployed them on the Netlify service. I passed several queries via GET request, locally they passed as an array but once it is deployed they passed as a string. lambda function side: export const handler =…
Thomas Jiang
  • 129
  • 11
1
vote
1 answer

Nodejs and Mailgun: Send generated attachment *not* from file system

I generate attachments in a node app and would like to send them using Mailgun. I have no access to the file system (Netlify functions). Is there an easy way to accomplish that? The hole picture It's a Jamstack (Gatsby/React, Netlify, Mailgun) web…
Stefan
  • 576
  • 7
  • 27
1
vote
1 answer

Netlify & Firebase

I am using Netlify Serverless Functions. I want to retrieve and save data to the firebase firestore. I use firebase-admin SDK. The following is the initialization: var admin = require("firebase-admin"); var serviceAccount =…
Danish Saeed
  • 49
  • 1
  • 5
1
vote
1 answer

Netlify Lambda function log hangs forever

The Function Log seems has the spinning slash forever. here is my…
Franva
  • 6,565
  • 23
  • 79
  • 144
1
vote
0 answers

Gatsby + Netlify add push notification

(have seen a few similar questions, but they do not solve my problem and none of them have a full example.) I am trying to add push notification to my Gatsby + Netlify CMS website. What I have: I have a website created by Gatsbyjs + Netlify CMS and…
1
vote
1 answer

"Cannot POST /" in Vue (Gridsome) App - Netlify Forms prevent redirect

I am building a personal website with Gridsome. I am trying to set up a newsletter signup form via Netlify Forms. I don't want the user to be redirected after clicking 'Submit'. To prevent that I use @submit.prevent like so:
Rasul Kireev
  • 369
  • 1
  • 2
  • 16
1
vote
1 answer

Unable to fetch Data in Netlify Dev Proxy (React)

I've been having CORS error when deploying my app so I decided to try out Netlify Dev. I followed all steps of the written tutorials but I keep getting errors without being able to identify whats wrong. I haven't even deployed it yet and right now I…
Parsa
  • 111
  • 3
  • 14
0
votes
0 answers

Using a Nelify function for Mailjet subscriptions

I'm trying to set up a newsletter subscription form on a site hosted on Netlify. When a user submits an email address, I'd like it to be added to my contact list on Mailjet. To do this without a third-party service like Zapier, it's necessary to use…
0
votes
0 answers

Netlify function to access the event.body objects

I am creating Netlify function and I want to access the event.body objects (especially the event.body.mode/requestBody.mode) but console.log gives me undefined. exports.handler = async function (event) { const requestBody = event.body; …
jmozzart
  • 123
  • 8
0
votes
0 answers

How to access an auth code in a magic link from Supabase on the server side (Netlify function)?

I'm trying to authenticate users via magic link with vanilla JS, Supabase, and Netlify functions — keeping all the authentication on the server side and keys out of the browser. I can successfully send a magic link to a user, which redirects them to…
amatur
  • 317
  • 2
  • 11
0
votes
0 answers

Problem to trigger functions/sendmail with sendgrid in react(endpoint /.netlify/functions/sendmail not found 404)

Im trying to send emails from my react web application via netlify functions and I can not trigger the handler of my sendmail.js which is in my functions folder. I´m always getting the same error http:localhost:8080/(here I tried a lot of routes…