Skip to content

Commit 3c250fc

Browse files
authored
Merge branch 'dev' into dashboard/changelog
2 parents 31e7e76 + 54ce8cb commit 3c250fc

197 files changed

Lines changed: 20529 additions & 12523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/CLAUDE-KNOWLEDGE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ const [result1, result2] = await Promise.all([
178178
```
179179

180180
### Q: What's the correct way to update project configuration in E2E tests?
181-
A: Use the `/api/v1/internal/config/override` endpoint with PATCH method and admin access token:
181+
A: Use the `/api/v1/internal/config/override/environment` endpoint with PATCH method and admin access token:
182182
```typescript
183-
await niceBackendFetch("/api/v1/internal/config/override", {
183+
await niceBackendFetch("/api/v1/internal/config/override/environment", {
184184
method: "PATCH",
185185
accessType: "admin",
186186
headers: {

.cursor/hooks/stop-check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414

1515
# Run typecheck and lint
1616
pnpm run typecheck 1>&2 || exit 2
17-
pnpm run lint 1>&2 || exit 2
17+
pnpm run lint --fix 1>&2 || exit 2
1818

1919
exit 0
2020

.github/workflows/db-migration-backwards-compatibility.yaml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
name: DB migrations are backwards-compatible with main branch
1+
name: DB migrations are backwards-compatible
22

33
on:
44
push:
5-
branches:
5+
branches-ignore:
66
- main
7-
- dev
87
pull_request:
98

109
concurrency:
1110
group: ${{ github.workflow }}-${{ github.ref }}
12-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
11+
cancel-in-progress: ${{ github.ref != 'refs/heads/dev' }}
1312

1413
jobs:
1514
check-migrations-changed:
1615
name: Check if migrations changed
1716
runs-on: ubuntu-latest
1817
outputs:
1918
migrations_changed: ${{ steps.check-diff.outputs.migrations_changed }}
19+
base_branch: ${{ steps.check-diff.outputs.base_branch }}
2020
steps:
2121
- name: Checkout current branch
2222
uses: actions/checkout@v6
@@ -26,9 +26,17 @@ jobs:
2626
- name: Check for migration changes
2727
id: check-diff
2828
run: |
29-
# Get the merge base with main
30-
git fetch origin main
31-
MERGE_BASE=$(git merge-base HEAD origin/main)
29+
# Determine base branch: dev compares to main, all others compare to dev
30+
if [ "${{ github.ref }}" = "refs/heads/dev" ]; then
31+
BASE_BRANCH="main"
32+
else
33+
BASE_BRANCH="dev"
34+
fi
35+
echo "base_branch=$BASE_BRANCH" >> $GITHUB_OUTPUT
36+
37+
# Get the merge base with the base branch
38+
git fetch origin $BASE_BRANCH
39+
MERGE_BASE=$(git merge-base HEAD origin/$BASE_BRANCH)
3240
3341
# Check if there are any changes in the migrations folder
3442
if git diff --quiet "$MERGE_BASE" HEAD -- apps/backend/prisma/migrations/; then
@@ -40,7 +48,7 @@ jobs:
4048
fi
4149
4250
backwards-compatibility:
43-
name: Test migrations with main branch code
51+
name: Test migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code
4452
needs: check-migrations-changed
4553
if: needs.check-migrations-changed.outputs.migrations_changed == 'true'
4654
runs-on: ubicloud-standard-8
@@ -62,25 +70,19 @@ jobs:
6270
mkdir -p saved-migrations
6371
cp -r current-branch/apps/backend/prisma/migrations/* saved-migrations/
6472
65-
# Now checkout main branch
66-
- name: Checkout main branch
73+
# Now checkout base branch (main for dev, dev for all others)
74+
- name: Checkout base branch
6775
uses: actions/checkout@v6
6876
with:
69-
ref: main
70-
path: main-branch
77+
ref: ${{ needs.check-migrations-changed.outputs.base_branch }}
78+
path: base-branch
7179

72-
# Replace main's migrations with current branch's migrations
73-
- name: Replace migrations with current branch migrations
74-
run: |
75-
rm -rf main-branch/apps/backend/prisma/migrations/*
76-
cp -r saved-migrations/* main-branch/apps/backend/prisma/migrations/
77-
78-
# Move main-branch to the root for the rest of the workflow
80+
# Move base-branch to the root for the rest of the workflow (keep base's migrations for now)
7981
- name: Setup working directory
8082
run: |
8183
shopt -s dotglob
82-
mv main-branch/* .
83-
rm -rf main-branch current-branch saved-migrations
84+
mv base-branch/* .
85+
rm -rf base-branch current-branch
8486
8587
- name: Setup Node.js
8688
uses: actions/setup-node@v6
@@ -194,9 +196,27 @@ jobs:
194196
- name: Wait 10 seconds
195197
run: sleep 10
196198

197-
- name: Run tests
199+
# First test run: base branch with base's migrations
200+
- name: Run tests (base branch with original migrations)
198201
run: pnpm test
199202

203+
# Now copy over current branch's migrations and run migrate
204+
- name: Replace migrations with current branch migrations
205+
run: |
206+
rm -rf apps/backend/prisma/migrations/*
207+
cp -r saved-migrations/* apps/backend/prisma/migrations/
208+
rm -rf saved-migrations
209+
210+
- name: Run database migrations
211+
run: pnpm run db:migrate
212+
213+
# Second test run: base branch code with new migrations applied
214+
- name: Run tests (base branch with new migrations)
215+
run: pnpm test
216+
217+
- name: Verify data integrity
218+
run: pnpm run verify-data-integrity
219+
200220
- name: Print Docker Compose logs
201221
if: always()
202222
run: docker compose -f docker/dependencies/docker.compose.yaml logs

.github/workflows/e2e-api-tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ jobs:
145145
run: sleep 10
146146

147147
- name: Run tests
148-
run: pnpm test
148+
run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
149149

150150
- name: Run tests again, to make sure they are stable (attempt 1)
151151
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
152-
run: pnpm test
152+
run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
153153

154154
- name: Run tests again, to make sure they are stable (attempt 2)
155155
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
156-
run: pnpm test
156+
run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
157157

158158
- name: Verify data integrity
159159
run: pnpm run verify-data-integrity

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"typescript.tsdk": "node_modules/typescript/lib",
88
"editor.tabSize": 2,
99
"cSpell.words": [
10+
"pushable",
1011
"autoupdate",
1112
"backlinks",
1213
"Cancelation",

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,16 @@ To see all development ports, refer to the index.html of `apps/dev-launchpad/pub
8383
- NEVER try-catch-all, NEVER void a promise, and NEVER .catch(console.error) (or similar). In most cases you don't actually need to be asynchronous, especially when UI is involved (instead, use a loading indicator! eg. our <Button> component already takes an async callback for onClick and sets its loading state accordingly — if whatever component doesn't do that, update the component instead). If you really do need things to be asynchronous, use `runAsynchronously` or `runAsynchronouslyWithAlert` instead as it deals with error logging.
8484
- WHENEVER you create hover transitions, avoid hover-enter transitions, and just use hover-exit transitions. For example, `transition-colors hover:transition-none`.
8585
- Any environment variables you create should be prefixed with `STACK_` (or NEXT_PUBLIC_STACK_ if they are public). This ensures that their changes are picked up by Turborepo (and helps readability).
86+
- NEVER just silently use fallback values or whatever when you don't know how to fix type errors. If there is a state that should never happen because of higher-level logic, and the type system doesn't represent that, either update the types or throw an error. Stuff like `?? 0` or `?? ""` is often code smell when `?? throwErr("this should never happen because XYZ")` would be better.
8687
- Code defensively. Prefer `?? throwErr(...)` over non-null assertions, with good error messages explicitly stating the assumption that must've been violated for the error to be thrown.
8788
- Try to avoid the `any` type. Whenever you need to use `any`, leave a comment explaining why you're using it (optimally it explains why the type system fails here, and how you can be certain that any errors in that code path would still be flagged at compile-, test-, or runtime).
8889
- Don't use Date.now() for measuring elapsed (real) time, instead use `performance.now()`
90+
- Use urlString`` or encodeURIComponent() instead of normal string interpolation for URLs, for consistency even if it's not strictly necessary.
91+
- When making config updates, use path notation (`{ "path.to.field": my-value }`) to avoid overwriting sibling properties
92+
- IMPORTANT: Any assumption you make should either be validated through type system (preferred), assertions, or tests. Optimally, two out of three.
93+
- If there is an external browser tool connected, use it to test changes you make to the frontend when possible.
94+
- Whenever you update an SDK implementation in `sdks/implementations`, make sure to update the specs accordingly in `sdks/specs` such that if you reimplemented the entire SDK from the specs again, you would get the same implementation. (For example, if the specs are not precise enough to describe a change you made, make the specs more precise.)
95+
- When building internal tools for Stack Auth developers (eg. internal interfaces like the WAL info log etc.): Make the interfaces look very concise, assume the user is a pro-user. This only applies to internal tools that are used primarily by Stack Auth developers.
8996

9097
### Code-related
9198
- Use ES6 maps instead of records wherever you can.

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
---
44

5+
## 2026.01.23
6+
7+
### Payments
8+
Introduced a redesigned payments onboarding flow
9+
10+
## 2026.01.21
11+
12+
### Payments
13+
- Payments page updated with new UI changes
14+
- Added a new Payments Settings page with an option to temporarily disable all payments
15+
- Subscription renewal emails are now sent automatically to users
16+
- Past payment invoices are now visible on the Account Settings page
17+
18+
### Documentation
19+
- Updated JWT documentation to include `isRestricted` and `restrictedReason`
20+
21+
## 2026.01.19
22+
- Updated package dependencies to their newest versions.
23+
524
## 2025.12.19
625
- Introduces new changelog and deprecates all older changelogs.
726
- Moved away from semantic versioning in favor of CalVer.

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ For vibecoding, it can help to have multiple parallel copies of the codebase ope
4343
```sh
4444
# ~/.bash_profile, ~/.bashrc, ~/.zprofile, ~/.zshrc, ~/.zshenv, etc.
4545
# note that different coding agents use a different shell in a different mode (login, non-login, interactive, non-interactive, etc.); from my experimentation, as of 2025-10-17 on a Mac, Cursor uses non-interactive zsh (requiring ~/.zshenv), whereas Codex uses a non-interactive login bash (requiring ~/.bash_profile). It's easiest to just add these lines of code to all of your shell configs.
46-
eval "$(direnv hook <bash|zsh>)"
47-
eval "$(direnv export <bash|zsh>)"
46+
# also, make sure to use the correct path to the direnv binary; for example, on a Mac with Homebrew installed, it is /opt/homebrew/bin/direnv
47+
eval "$(/path/to/direnv hook <bash|zsh>)"
48+
eval "$(/path/to/direnv export <bash|zsh>)"
4849
```
4950
3. Now, create a `.envrc` file in the root of Stack Auth's codebase with the following content:
5051
```sh

README.md

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ We support Next.js, React, and JavaScript frontends, along with any backend that
3434
- [Requirements](#requirements)
3535
- [Setup](#setup)
3636
- [Useful commands](#useful-commands)
37-
- [Chat with the codebase](#chat-with-the-codebase)
38-
- [Architecture overview](#architecture-overview)
3937
- [❤ Contributors](#-contributors)
4038

4139
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -142,7 +140,7 @@ pnpm restart-deps
142140
pnpm dev
143141
144142
# In a different terminal, run tests in watch mode
145-
pnpm test
143+
pnpm test # useful: --no-watch (disables watch mode) and --bail 1 (stops after the first failure)
146144
```
147145

148146
You can now open the dev launchpad at [http://localhost:8100](http://localhost:8100). From there, you can navigate to the dashboard at [http://localhost:8101](http://localhost:8101), API on port 8102, demo on port 8103, docs on port 8104, Inbucket (e-mails) on port 8105, and Prisma Studio on port 8106. See the dev launchpad for a list of all running services.
@@ -196,51 +194,6 @@ pnpm verify-data-integrity: Verify the integrity of the data in the database by
196194
197195
Note: When working with AI, you should keep a terminal tab with the dev server open so the AI can run queries against it.
198196
199-
### Chat with the codebase
200-
201-
Storia trained an [AI on our codebase](https://sage.storia.ai/stack-auth) that can answer questions about using and contributing to Stack Auth.
202-
203-
### Architecture overview
204-
205-
```mermaid
206-
graph TB
207-
Website[Your Website]
208-
User((User))
209-
Admin((Admin))
210-
subgraph "Stack Auth System"
211-
Dashboard[Stack Auth Dashboard<br/>/apps/dashboard]
212-
Backend[Stack Auth API Backend<br/>/apps/backend]
213-
Database[(PostgreSQL Database)]
214-
EmailService[Email Service<br/>Inbucket]
215-
WebhookService[Webhook Service<br/>Svix]
216-
StackSDK[Client SDK<br/>/packages/stack]
217-
subgraph Shared
218-
StackUI[Stack Auth UI<br/>/packages/stack-ui]
219-
StackShared[Stack Auth Shared<br/>/packages/stack-shared]
220-
StackEmails[Stack Auth Emails<br/>/packages/stack-emails]
221-
end
222-
end
223-
Admin --> Dashboard
224-
User --> Website
225-
Website --> StackSDK
226-
Backend --> Database
227-
Backend --> EmailService
228-
Backend --> WebhookService
229-
Dashboard --> Shared
230-
Dashboard --> StackSDK
231-
StackSDK --HTTP Requests--> Backend
232-
StackSDK --> Shared
233-
Backend --> Shared
234-
classDef container fill:#1168bd,stroke:#0b4884,color:#ffffff
235-
classDef database fill:#2b78e4,stroke:#1a4d91,color:#ffffff
236-
classDef external fill:#999999,stroke:#666666,color:#ffffff
237-
classDef deprecated stroke-dasharray: 5 5
238-
class Dashboard,Backend,EmailService,WebhookService,Website container
239-
class Database database
240-
```
241-
242-
Thanks to [CodeViz](https://www.codeviz.ai) for generating the diagram!
243-
244197
## ❤ Contributors
245198
246199
<a href="https://github.com/stack-auth/stack-auth/graphs/contributors">

apps/backend/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ STACK_SETUP_ADMIN_GITHUB_ID=# enter the account ID of the admin user here, and a
8787
OTEL_EXPORTER_OTLP_ENDPOINT=# enter the OpenTelemetry endpoint here. Optional, default is `http://localhost:8131`
8888
STACK_INTEGRATION_CLIENTS_CONFIG=# a list of oidc-provider clients for integrations. If not provided, disables integrations
8989
STACK_FREESTYLE_API_KEY=# enter your freestyle.sh api key
90+
STACK_VERCEL_SANDBOX_PROJECT_ID=# enter the project id for the vercel project that the vercel engine will use
91+
STACK_VERCEL_SANDBOX_TEAM_ID=# enter the team id for the vercel project that the vercel engine will use
92+
STACK_VERCEL_SANDBOX_TOKEN=# enter the token for the vercel project that the vercel engine will use
9093
STACK_OPENAI_API_KEY=# enter your openai api key
9194
STACK_FEATUREBASE_API_KEY=# enter your featurebase api key
9295
STACK_STRIPE_SECRET_KEY=# enter your stripe api key

0 commit comments

Comments
 (0)