Changelog¶
0.3.2¶
Docs only. Production issuer is https://auth.last1.id. client_id accepts the Client ID UUID or the App ID slug.
0.3.1¶
CommonJS interop for Node backends that compile to require().
- New
dist/index.cjsartifact and"require"export condition so packages like last.vet-api (Express +tsc→ CommonJS) canrequire("@last1id/sdk")withoutERR_PACKAGE_PATH_NOT_EXPORTED. - Run
node scripts/build-sdk-cjs.mjsbefore publish to regenerate the CJS bundle from the ESM dist.
0.3.0¶
Cross-app revoke webhook signature verification.
- New
verifyWebhookSignature(secretB64, header, rawBody, options?)helper — partners use this in their/api/webhooks/last1handler to validate inboundconsent.revoked/app_link.revokedevents from last1.id. Validates the Stripe-stylet=<unix>,v1=<hex>envelope, enforces a 5-minute replay window (configurable), and supports multi-v1=rotation windows. - New typed error
Last1WebhookSignatureErrorwith a discriminated.codefield (missing_header|malformed_header|stale_timestamp|signature_mismatch|secret_invalid) so partners can distinguish hard config bugs from operational signal-loss. - Documented integration guide in
docs/PARTNER_WEBHOOKS.mdon the server repo, including raw-Node and Express reference handlers, idempotency notes, and the production-only HTTPS-required invariant.
0.2.0¶
Partner-facing read surface (Phase 1c) plus auto-refresh client.
- New helpers —
fetchUserinfo,listCredentials,getCredential,listTrustEvents,getAppLinkSelf. Each takes{ issuerUrl, accessToken }and returns typed results. - New
Last1Clientclass — wraps the helpers and transparently refreshes on a 401 invalid_token. Concurrent 401s coalesce into a single refresh so the single-use refresh-token chain is not burned by parallel requests.onTokensRefreshedhook lets callers persist the rotated pair. - New typed errors —
Last1HttpError(any HTTP failure with.status+.code+.detail) andLast1AuthError(subclass thrown when the refresh chain is unrecoverable; partners should drop the user out to a re-link flow). - Existing helpers (
exchangeCode,refreshToken) now throw the typed error classes instead of genericError, so partners cancatch (e) { if (e instanceof Last1AuthError) ... }.
0.1.0¶
- Initial publishable SDK skeleton.
- PKCE helper support.
- Authorize URL generation.
- Token exchange and refresh helpers.