After you purchase X Sched, you’ll get an email with a license key and a private link to a zip file. Download and extract the zip file.
The extracted folder contains the minified X Sched code that you need to deploy to Vercel. Before doing that, open the .env
file in a text editor (e.g., VS Code, Sublime Text).
Tip: Nearly every section includes a screen recording that demonstrates the required task. It's highly recommended to watch them
This file contains all the API keys and configurations required for running X Sched. It’s the only file you need to configure before deploying X Sched.
LICENSE_KEY=__REPLACE_THIS__ X_API_KEY=__REPLACE_THIS__ X_API_SECRET=__REPLACE_THIS__ INNGEST_EVENT_KEY=__REPLACE_THIS__ INNGEST_SIGNING_KEY=__REPLACE_THIS__ UPLOADTHING_SECRET=__REPLACE_THIS__ UPLOADTHING_APP_ID=__REPLACE_THIS__ POSTGRES_URL=__REPLACE_THIS__ NEXTAUTH_SECRET=__REPLACE_THIS__
First step: Copy and paste the license key you received and set it as the value for the LICENSE_KEY
environment variable.
.env
fileLICENSE_KEY=25B973EE-example-A7497846-710GE48F X_API_KEY=KpLwiN-example-cdGlq X_API_SECRET=RpZOntDVcLOyUDEJ-example-cwbenC7oioxfddcsHnb45 INNGEST_SIGNING_KEY=__REPLACE_THIS__ INNGEST_EVENT_KEY=__REPLACE_THIS__ UPLOADTHING_SECRET=__REPLACE_THIS__ UPLOADTHING_APP_ID=__REPLACE_THIS__ POSTGRES_URL=__REPLACE_THIS__ NEXTAUTH_SECRET=__REPLACE_THIS__
Next, we’ll go through how to retrieve the values for the other environment variables.
The setup uses bash, so make sure it’s available in your environment. If you’re on Windows, consider using Git BASH). On Unix-based systems (OSX, Linux), bash is the default.
You also need the latest Node.js LTS version with NPM installed.
You don’t need to have existing accounts for the required services. However, if you’re already signed up, you can use your existing accounts.
X Sched depends on the following APIs and services. You need to be signed up or create an account for each of them:
Tip: I recommend using the GitHub login option since all these services support it and the signup process is smoother compared to email.
Visit the X Developer Portal and click "Sign up for Free Account". On the next screen, fill out the field "Describe all of your use cases of Twitter’s data and API" by copying and pasting the following text:
On the next page, click "Create Project". Name your project, e.g., "X Sched". For "Use case", choose "Doing something else", and copy and paste the text from before into the "Project description" field. Name your new app, e.g., "X Sched - Your Name". The name has to be unique.
If everything goes smoothly, you should see a screen with your API Key
and API Key Secret
. Copy these two values into the .env file and replace the values of X_API_KEY
and X_API_SECRET
with them.
.env
fileLICENSE_KEY=25B973EE-example-A7497846-710GE48F X_API_KEY=KpLwiN-example-cdGlq X_API_SECRET=RpZOntDVcLOyUDEJ-example-cwbenC7oioxfddcsHnb45 INNGEST_EVENT_KEY=__REPLACE_THIS__ INNGEST_SIGNING_KEY=__REPLACE_THIS__ UPLOADTHING_SECRET=__REPLACE_THIS__ UPLOADTHING_APP_ID=__REPLACE_THIS__ POSTGRES_URL=__REPLACE_THIS__ NEXTAUTH_SECRET=__REPLACE_THIS__
We’ll configure the callback URLs for our X app later, but for now, let’s continue with the other services.
Sign up to Inngest and go through the onboarding process. Click on "Sync App" and copy the INNGEST_SIGNING_KEY
. Leave the App URL
input empty for now. We’ll return to it later. At the top of the page, switch to the "Events" tab and also copy the INNGEST_EVENT_KEY
. Add both values to the .env file.
.env
fileLICENSE_KEY=25B973EE-example-A7497846-710GE48F X_API_KEY=KpLwiN-example-cdGlq X_API_SECRET=RpZOntDVcLOyUDEJ-example-cwbenC7oioxfddcsHnb45 INNGEST_SIGNING_KEY=signkey-prod-b5df744sfafum9ddb-example-d04af372545390e82b4ec194 INNGEST_EVENT_KEY=CjNQTU1v9H_A2Ph0ktXQM2y5yEdfsfi7xp-example-sDGTo78eBRN4J9rfJby8ScVZw UPLOADTHING_SECRET=__REPLACE_THIS__ UPLOADTHING_APP_ID=__REPLACE_THIS__ POSTGRES_URL=__REPLACE_THIS__ NEXTAUTH_SECRET=__REPLACE_THIS__
Sign up to Uploadthing, create a new app, and copy the UPLOADTHING_SECRET
and UPLOADTHING_APP_ID
into the .env
file
⚠️ You can't switch the default region on the free plan
.env
fileLICENSE_KEY=25B973EE-example-A7497846-710GE48F X_API_KEY=KpLwiN-example-cdGlq X_API_SECRET=RpZOntDVcLOyUDEJ-example-cwbenC7oioxfddcsHnb45 INNGEST_SIGNING_KEY=signkey-prod-b5df744sfafum9ddb-example-d04af372545390e82b4ec194 INNGEST_EVENT_KEY=CjNQTU1v9H_A2Ph0ktXQM2y5yEdfsfi7xp-example-sDGTo78eBRN4J9rfJby8ScVZw UPLOADTHING_SECRET=sk_live_88c4b8c3a7fbf-example-44f69b1b656c80bfb8d38703ef42f35 UPLOADTHING_APP_ID=t3f-example-sy4 POSTGRES_URL=__REPLACE_THIS__ NEXTAUTH_SECRET=__REPLACE_THIS__
Create a Vercel account. Before we deploy X Sched, we need to set two more environment variables.
To get the POSTGRES_URL
, open the Vercel dashboard and navigate to the "Storage" tab where you can create a new Postgres instance.
Open the detail view of the newly created Postgres instance, click on the ".env.local" tab and copy the POSTGRES_URL
.env
fileLICENSE_KEY=25B973EE-example-A7497846-710GE48F X_API_KEY=KpLwiN-example-cdGlq X_API_SECRET=RpZOntDVcLOyUDEJ-example-cwbenC7oioxfddcsHnb45 INNGEST_SIGNING_KEY=signkey-prod-b5df744sfafum9ddb-example-d04af372545390e82b4ec194 INNGEST_EVENT_KEY=CjNQTU1v9H_A2Ph0ktXQM2y5yEdfsfi7xp-example-sDGTo78eBRN4J9rfJby8ScVZw UPLOADTHING_SECRET=sk_live_88c4b8c3a7fbf-example-44f69b1b656c80bfb8d38703ef42f35 UPLOADTHING_APP_ID=t3f-example-sy4 POSTGRES_URL=postgres://default:dU-example-q@ep-lucky-dew-189934-pooler.eu-central-1.postgres.vercel-storage.com/verceldb?sslmode=require NEXTAUTH_SECRET=__REPLACE_THIS__
Tip: You can also use a different Postgres provider such as Supabase or Neon
Before deploying X Sched, we need to set the NEXTAUTH_SECRET
, the last environment variable. This variable is used internally to encrypt the session. Either use a long, difficult-to-guess string or copy and paste the following randomly generated value:
.env
fileLICENSE_KEY=25B973EE-example-A7497846-710GE48F X_API_KEY=KpLwiN-example-cdGlq X_API_SECRET=RpZOntDVcLOyUDEJ-example-cwbenC7oioxfddcsHnb45 INNGEST_SIGNING_KEY=signkey-prod-b5df744sfafum9ddb-example-d04af372545390e82b4ec194 INNGEST_EVENT_KEY=CjNQTU1v9H_A2Ph0ktXQM2y5yEdfsfi7xp-example-sDGTo78eBRN4J9rfJby8ScVZw UPLOADTHING_SECRET=sk_live_88c4b8c3a7fbf-example-44f69b1b656c80bfb8d38703ef42f35 UPLOADTHING_APP_ID=t3f-example-sy4 POSTGRES_URL=postgres://default:dU-example-q@ep-lucky-dew-189934-pooler.eu-central-1.postgres.vercel-storage.com/verceldb?sslmode=require NEXTAUTH_SECRET=d2927096-example-35e5ad672a4f
Now all environment variables in your .env
file should have a value, and we are ready to deploy X Sched to Vercel.
cd
into the extracted X Sched directory and run the following command:
npx zx ./deploy.mjs
This command applies the necessary database migrations and deploys the app to Vercel
You might need to log into your Vercel account if this is your first time using the Vercel CLI on your machine. If you get an error such as "Error: No existing credentials found. Please run `vercel login`", run npx vercel login
first, and then the deploy command again
If you now open the Vercel dashboard, you should see your X Sched instance. Click on the link under the app’s name to visit the website.
For the last step, copy your app’s URL and go back to the X Developer Portal. Go to your app’s settings and click on the "Set up" button under "User authentication settings".
Select "Read and write and Direct message", turn on "Request email from users", choose "Web App, Automated App or Bot" as the type of your app, and set the callback URL like this (adjust the first part):
https://YOUR-XSCHED-INSTANCE.vercel.app/api/auth/callback/twitter
Also use your X Sched URL as the "Website URL", "Terms of service" and "Privacy policy". Finally click "Save" and you’re done here.
Open the Inngest dashboard and click on "Sync app". Enter the following URL in the App URL
field (adjust the first part):
https://YOUR-XSCHED-INSTANCE.vercel.app/api/inngest
Click on "Sync App" and you’re also done here
Open your X Sched instance and log in with your X credentials. Publish a post or schedule a thread for later. Upload an image, save a draft, and perfect it before publishing. The initial setup might have been a bit tedious, but now you’re done and can use X Sched forever.
f you’re struggling with anything in this guide or something doesn’t work as expected, please don’t hesitate to DM me on X
Updating your deployed version is straightforward. Follow these steps:
.env
values. You can either add the new values manually or replace the .env
file with the one from your last deployed version.cd
into the unzipped directory and run the following command:npx zx ./deploy.mjs