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
23
votes
2 answers

SSR explained in SvelteKit

I recently started working with Svelte via SvelteKit and I have a few questions about this framework to which I haven't been able to find any direct answers in the source/documentation: SvelteKit has SSR and in the documentation it says: All…
5
votes
4 answers

How to share code between Netlify lambda functions

I have 3 separate functions each in their own folders. All of them make use of a Twilio client and Apollo Client for dealing with SMS and GraphQL server respectively. Rather than having all the code to instantiate each client (get keys from env…
Jon Wyatt
  • 1,786
  • 1
  • 11
  • 16
4
votes
1 answer

Debug Netlify Functions in VS Code

I'm trying to set a breakpoint inside of a netlify function that is executed via netlify dev with the following setup: Setup Install Netlify-CLI npm install netlify-cli -g netlify.toml [build] functions =…
KyleMit
  • 30,350
  • 66
  • 462
  • 664
3
votes
1 answer

Gatsby cloud removing netlify functions from Netlify

I have netlify functions setup in my gatsby project with proxying and so forth. If i deploy through netlify everything works as expected. If I do another deploy with gatsby cloud it actually removes my netlify functions from netlify. I have tried…
2
votes
2 answers

How to use Github API to revoke OAuth authentication?

Here is the code I'm using, but I keep getting a 403 error in response. let username = "CLIENT_ID_GOES_HERE"; let password = "SECRET_GOES_HERE"; let basicAuth = Buffer.from(`${username}:${password}`).toString('base64'); try { response = await…
Dominique
  • 374
  • 4
  • 16
2
votes
0 answers

Should I run email dispatching code via Sveltekit endpoints, Netlify functions or Netlify Edge?

I have an order page for which I handle form submission via a POST RequestHandler in a SvelteKit endpoint (code example). This endpoint is, so far, mostly in charge of persisting the submitted data via the Sanity Client API. Now, I want to dispatch…
nimser
  • 620
  • 2
  • 9
  • 22
2
votes
2 answers

Netlify functions not found on dev server

I have followed several blogs and questions related to the same problem I am having. It is exactly like this question. However, I am still having issues. So, I am running netlify dev and trying to access my netlify functions. I have a function in…
yankeedoodle
  • 353
  • 2
  • 11
2
votes
0 answers

How insert result of a Netlify function into the HTML web page whose form called the function (example: calculator)

Background: I'm coming from the server-side world of Rails, and trying to figure out the Netlify static html + serverless functions approach to doing a few extremely basic landing page web apps which need a serverless function to insert data into an…
jpw
  • 18,697
  • 25
  • 111
  • 187
2
votes
1 answer

How to get the raw request body in a Netlify Function?

I'm developing a backend for an existing application which sends Gzipped data to an endpoint on Netlify Functions. However, I wasn't able to get the body as a Buffer instead of a string. This means that Zlib is unable to decompress the body since…
Gadget
  • 183
  • 1
  • 7
2
votes
1 answer

Problem with Nuxt3 + Netlify Functions + Rewrite

My rewrites are not working on netlify/production but I have no problems when running them locally with netlify dev. The netlify.toml looks like this: [build] command = "npm run build" functions = "functions" publish = "dist" [[redirects]] from =…
teh.fonsi
  • 3,040
  • 2
  • 27
  • 22
2
votes
1 answer

Returning Promises from Netlify Function

I am working on a serverless function to be hosted on Netlify to subscribe users to a mailchimp email list. I am getting the following obscure error: lambda response was undefined. check your function code again Here is my function: const handler =…
2
votes
0 answers

do netlify functions not work with axios headers?

ok so i'm trying to make an api call using netlify functions and if i try calling another api that does not require headers it works perfectly but when i include headers the promise returns as 'undefined' const axios =…
2
votes
2 answers

Error "SyntaxError: Cannot use import statement outside a module" when deploying React app with Netlify Functions

I deployed an app using Netlify Functions and got an error ""errorType":"Runtime.UserCodeSyntaxError","errorMessage":"SyntaxError: Cannot use import statement outside a module"". How can I solve this? I used create-react-app to make the app. I…
2
votes
0 answers

How do I update Netlify identity user's app metadata?

I am using gotrue-js in react to signup and login users to my netlify identity. I am getting an error called "data":{"code":401,"msg":"Invalid token: signature is invalid"}". I am running this locally (on localhost:8888) and using netlify cli to run…
2
votes
0 answers

Serve static image using netlify?

I am currently using express and I want to host my website with netlify but the problem is I don't know how to serve static images with netlify. While normally running the app not using netlify everything works. Is there a way to serve static images…
Dusan
  • 105
  • 7
1
2 3 4 5 6 7 8