A production-ready Next.js boilerplate with complete Memberstack authentication (login, signup, password reset, protected routes) pre-configured for Webflow Cloud deployment.
- Webflow account
- Memberstack account
- GitHub account
- Node.js 20.0.0+ and npm
# Clone this repo
git clone https://github.com/julianmemberstack/webflow-cloud-auth.git
cd webflow-cloud-auth
npm installThen create a new repository on github.com/new and push to it:
git remote set-url origin https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git
git push -u origin main- Sign in to Memberstack
- Go to Dev Tools in your Memberstack dashboard
- Look near the top right - you'll see your Public Key and Secret Key
- Copy the correct live or test mode credentials depending on what you want
cp .env.example .envOpen .env and add your Memberstack credentials:
NEXT_PUBLIC_MEMBERSTACK_PUBLIC_KEY="pk_sb_xxxxxxxxxxxxxx"
MEMBERSTACK_SECRET_KEY="sk_sb_xxxxxxxxxxxxxx"npm run devOpen http://localhost:3000/app and test the authentication features.
- In your Webflow site, go to Site Settings > Webflow Cloud
- Click Login to GitHub and authorize
- Click Install GitHub App and grant access to your repository
- Click Create New Project:
- Project Name: Whatever you want
- GitHub Repository: Select your repository
- Click Create Project
- Click Create Environment:
- Branch:
main - Mount Path:
/app - Click Create Environment
- Branch:
- Add your environment variables:
- Click Environment Variables tab
- Add
NEXT_PUBLIC_MEMBERSTACK_PUBLIC_KEYwith your public key - Add
MEMBERSTACK_SECRET_KEYwith your secret key (mark as secret) - Click Save
- Publish your Webflow site (button in top right of Designer)
- Deploy:
- Option A: Run
webflow cloud deployin your terminal - Option B: Just push to GitHub and it auto-deploys
- Option A: Run
Go to https://your-site.webflow.io/app to see your live app!
- Login and signup pages with validation
- Password reset flow (forgot password + reset)
- Protected account page with auth guard
- Automatic redirects for unauthenticated users
- Tailwind CSS + shadcn/ui components
- TypeScript
npm run dev # Local development
npm run build # Build for production
npm run preview # Test production build locally
npm run deploy # Deploy to Webflow Cloud"404 Not Found" when accessing /app
- Make sure you published your Webflow site after creating the environment
Authentication not working
- Verify both Memberstack environment variables are set in Webflow Cloud
- Make sure you're using keys from the same Memberstack app
- Check that your public key starts with
NEXT_PUBLIC_
Deployment not starting after Git push
- Go to Webflow Cloud settings and verify GitHub App has repo access
- Try
webflow cloud deploymanually
Made with Webflow Cloud, Memberstack, and Next.js