Config-driven, multi-context HTTP client with built-in OAuth2 token lifecycle management.
Prerequisites: Docker, Node.js 20+, python3, curl
# Start Keycloak (first run pulls image ~500MB)
cd poc/keycloak && docker compose up -d
# Wait for Keycloak & configure realm (takes ~30s on first run)
bash setup.sh
# Start mock API (separate terminal)
cd poc/mock-api && npm install && node server.jsIf you see "Realm 'morph' not found", the Docker volume has stale data:
docker compose down -v && docker compose up -d && bash setup.sh# From repository root
cd core && npm install && npm run build
cd ../poc/ts-vue && npm install
cd ../..
npm run devOpens http://127.0.0.1:5173/. Rebuild the SDK after core/ changes:
npm run build:corecd poc/keycloak && bash test-flows.shAll 5 tests should pass (device token, login, refresh rotation, token exchange, JWT decode).
See docs/poc/google-setup.md for external IdP integration.
| Path | Role |
|---|---|
core/ |
morph-api-client TypeScript SDK package |
core/src/runtime.ts |
MorphRuntime — thin coordinator |
core/src/tokens/ |
TokenLifecycle + TokenVault |
core/src/http/ |
HostPipeline (host HTTP + 401 recovery) |
core/src/client/ |
MorphClient, HostClient, AuthHandle facades |
poc/ts-vue/ |
Vue 3 demo app |
poc/keycloak/ |
Docker Keycloak realm + setup/test scripts |
poc/mock-api/ |
Mock REST API (Express, validates JWT via Keycloak/Google) |
docs/ |
Design & API docs |