- Gatsby Serverless Functions
In November 2020 I had an idea, I wanted to build an API so I could consume my Twitter Profile Data in two separate websites. In order to connect to the Twitter API requests must be made Server-side with a private API key. This is a really good example of how Serverless Functions can be used by everyday Front-end developers, such as myself. My first attempt at this used Netlify Functions, you can read more about that in ths post: Use Netlify Functions and the Twitter API v2 as a CMS for your Gatsby blog.
In June 2021, shortly after Gatsby announced the release of Gatsby Serverless Functions, I migrated the site from Netlify to Gatsby Cloud, and made it look a little nicer.
Paulie API is a “static” docs site built with Gatsby, but it also acts as a standalone API. A number of the endpoints documented on the site are used here on paulie.dev. I’ve also used one of the end-points on this demo site built with astro and deployed to GitHub pages: pauliescanlon.github.io
Here’s a diagram showing some of the ways I’m using the endpoints
I’m really pleased with this project as it blows away many of the comments you see that claim “Gatsby is just for blogs”.
I also use one of the end-points for my Open-source project MDX Embed. This endpoint connects with the Stripe API to enable pay what you want contributions, an idea first suggested by my good friend Benedicte Raae.
I wrote about how this works in this article for Smashing Magazine, oh, I and created this cool motion graphics video to promote the article.
If you’ve tried using @GatsbyJs Functions, you’ll know that they open up a whole new world for front-end developers. @PaulieScanlon explains how he built his open-project by using @storybookjs and the Stripe API:https://t.co/0iB5zC0Caa pic.twitter.com/N931yMY17F— Smashing Magazine 🇺🇦 🏳️🌈 (@smashingmag) September 17, 2021