✨ I made a no-code feature flag system with Airtable and am using that to hide or display sections on a Next.js site. ✨
That's one way to help a client who can't decide when exactly something should go live on their site. 🤷🏾♂️
Here's how I did it. First I have a table that looks something like this. This is what the client sees when they edit the "Features" table (base, in Airtable lingo).
Airtable gives you an automatic API for each base. In the case of the Features base, I click into the API documentation and see that it looks like this.
This is a test base, I am not worried that you see my base ID in the screenshot.
Incremental static regeneration allows us to build a static site using the results of an API call (such as a headless CMS, or Airtable 😂) but will regenerate the site on an interval.
On the page where I need this I have a getStaticProps() function at the bottom of the page that uses axios to query the Airtable API at build time.
The features object is passed in as props to the page component, and then revalidated & saved every 300 seconds.
That's it! 🎉
I'm thinking about using Airtable as the cms for @everyoak this year, letting schools edit their own registration instructions and school info instead of sending me walls of text.
Watch me willingly open up my site for XSS attacks...
I’m going to write this up so it’s accessible and more long-lived.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
If you are building a SaaS from scratch, have your Users belong to Teams, and attach billing information to the Team not User. While you're there, create a Membership model to be the join table between User/Team and assign a role to the User like Owner, Admin, or Readonly.
This signals that your app is business-friendly. It allows you to assign limits and features at the Team level. It allows for users to ask for their accounts to be deleted without it affecting the billing status of the entire team. It allows a team to kill a teammate's account.
"but I'm building a b2c, do I need teams?"
Personal finance tool: user wants spouse to see their budget
Notetaking tool: user wants to share notes with family
Videogame recc app: user wants girlfriend to add their games to library