Skip to content

[Don't merge] docs: add Switching to Production section and env-driven SDK environment#20

Open
maciejwitowski wants to merge 1 commit into
mainfrom
docs/switching-to-production
Open

[Don't merge] docs: add Switching to Production section and env-driven SDK environment#20
maciejwitowski wants to merge 1 commit into
mainfrom
docs/switching-to-production

Conversation

@maciejwitowski
Copy link
Copy Markdown
Contributor

Add NEXT_PUBLIC_VANA_ENV support to the nextjs-starter so the SDK environment (dev/prod) is controlled via a single env var. Document the production checklist: npm package, env flag, Data Connect release, app registration, and deployment.

Add NEXT_PUBLIC_VANA_ENV support to the nextjs-starter so the SDK
environment (dev/prod) is controlled via a single env var. Document
the production checklist: npm package, env flag, Data Connect release,
app registration, and deployment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vana-connect-nextjs-starter Ready Ready Preview Feb 21, 2026 2:57pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
connect Skipped Skipped Feb 21, 2026 2:57pm

Request Review

tnunamak added a commit that referenced this pull request May 4, 2026
…ns (#124)

Stacked on PR #112. Targets that branch so the integration lands as part
of the OIDC slice.

## Summary

When a user approves an account-action with `execution_mode ===
"embedded_wallet_account_hosted"`, account.vana.org now mints a real
on-chain grant on the user's Personal Server. Replaces the mock-only
path. Also addresses the hardcoded/missing-data audit findings flagged
earlier.

## What's wired

1. **`oauth_clients` registry table** (migration 007) — replaces the
localStorage admin store. Builder identity (`grantee_address`,
`builder_id`, `public_key`) is optional (Sign-in-with-Vana works without
it) but all-or-nothing when set.
2. **Admin API** (`/api/admin/oauth-clients`) — POST upsert, GET list,
DELETE; owner-auth via masterKeySignature.
3. **`executeGrantViaPersonalServer` helper** — pure function: resolves
user PS + OAuth client, POSTs `<ps-url>/v1/grants` with `Bearer
<control_plane_token>`.
4. **`handleActionDecision` real-grant branch** — when execution_mode is
`embedded_wallet_account_hosted`, calls executor before persisting;
failure aborts approval with a typed error.
5. **Consent event audit** — populates `subject_wallet_address` (primary
linked wallet), `application_id` (oauth_clients.protocolPrincipal),
`authorization_reference` ({grantId, granteeAddress, personalServer}).
Subject wallet on denial too.
6. **`DEFAULT_ACCOUNT_ACTION_ISSUER`** reads `VANA_ACCOUNT_ISSUER` env
with literal fallback.
7. **DB-backed registry** with `DEV_MEMORY_APP_CLIENT` fallback so demo
flows keep working when the table is empty.

## Migration

`007_add_oauth_clients.sql` already applied to dev (`ep-red-river`) and
prod (`ep-hidden-glade`) Neon branches.

## Tests

322 passed / 17 skipped (matches baseline).

## Out of scope

- Migrate device-code state from sessionStorage → DB (#20)
- Migrate passport agreement from localStorage → consent event (#21)
- Wire admin UI to use the new API (currently still writes localStorage;
the API is in place)
- Action-result revocation wiring

## Test plan

- [ ] CI passes
- [ ] On account-dev: register an OAuth client with builder identity via
POST /api/admin/oauth-clients
- [ ] Trigger an action request from the demo Memory App with
execution_mode=embedded_wallet_account_hosted
- [ ] Approve the action — observe POST to `<user-ps>/v1/grants`
succeed, `grantId` populated, `authorization_reference` set on consent
event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant