An example application covering:
- Signin via OAuth
- Fetch user profile data
- Persistent session storage with SQLite
git clone https://github.com/samsour/atproto-oauth-starter.git
cd atproto-oauth-starter
# Create .env file with your configuration
cp .env.example .env
npm install
npm run dev
# Navigate to http://localhost:8080
Create a .env
file in the root directory with the following variables:
NODE_ENV="development" # Options: 'development', 'production'
PORT="8080" # The port your server will listen on
HOST="localhost" # Hostname for the server
PUBLIC_URL="" # Set when deployed publicly, e.g. "https://mysite.com". Informs OAuth client id.
DB_PATH=":memory:" # The SQLite database path. Leave as ":memory:" to use a temporary in-memory database.
# Secrets
# Must set this in production. May be generated with `openssl rand -base64 33`
# COOKIE_SECRET=""
NODE_ENV
: Set to "development" for local development or "production" for production deploymentPORT
: The port number your server will listen on (default: 8080)HOST
: The hostname for your server (default: localhost)PUBLIC_URL
: Set this when deploying publicly. Used to generate the OAuth client IDDB_PATH
: Path to your SQLite database. Use ":memory:" for temporary in-memory storageCOOKIE_SECRET
: Required in production. Generate withopenssl rand -base64 33