First things first, fork this project to your own repo.
We'll need to add a table once your instance has been created.
Name the table revue_subscribers with the following columns:
- email (text)
- first_name (text)
- last_name (text)
- created_at (timestampz)
- convertkit_synced_at (timestampz)
You'll need your API keys from:
We need to add link our repo to a Vercel project to deploy it. We also need to configure our API keys as Vercel secrets.
Go to your Vercel dashboard, click "New Project", and provide your git repository.
Once you have your project created, we need to add secrets.
As you're creating the project, open the "Environment Variables" section.
Add each of these variables:
Once everything is configured, we can press deploy.
These different endpoints need to be hit once every 5-15 minutes, your choice. I'm defaulting to 5 so that any sequences start in a timely fashion after being added to ConvertKit.
This will be the URL from your deployment.
Cron jobs can be configured simply with GitHub Actions (source).
name: 5-minute-cron on: schedule: - cron: '*/5 * * * *' jobs: cron: runs-on: ubuntu-latest steps: - name: Call our API route run: | curl --request POST \ --url 'https://yoursite.com/api/cron' \
We need on of these for each endpoint:
Vercel does not automatically keep track of errors. Given that Sentry.io just rolled out a Next.js library for monitoring Next.js apps, I'd recommend signing up with their free tier ASAP.