Skip to content

0.8.1 release: expired connectAccessToken auto-recover#102

Merged
fuhrysteve merged 3 commits into
masterfrom
fuhry/sdk-0.8.1
May 18, 2026
Merged

0.8.1 release: expired connectAccessToken auto-recover#102
fuhrysteve merged 3 commits into
masterfrom
fuhry/sdk-0.8.1

Conversation

@fuhrysteve
Copy link
Copy Markdown
Contributor

@fuhrysteve fuhrysteve commented May 18, 2026

Release prep for [email protected].

Scope of 0.8.1

The only behavior change relative to 0.8.0 is the expired-token recovery wiring (the auto-recover interceptor shipped in #101). New optional init options:

  • connectAccessTokenRefreshFn?: () => Promise<string> — transparent refresh + retry on the SDK's side
  • onConnectAccessTokenExpired?: () => void — fires when no refresh hook is wired or it rejects

Also dispatches a tpastream-connect-token-expired CustomEvent on window. Strictly additive — integrations that don't opt in see no behavior change beyond a slightly cleaner server-side error message on expiry.

What this PR ships

  • Version bump to 0.8.1 (package.json + package-lock.json via npm version)
  • VERSION constants in assets/sdk/components/SDK.tsx and assets/sdk/entries/sdk-core.tsx (these get baked into bundle output; surface in the TPAStream Connect SDK v0.8.1 console banner)
  • CDN URL examples in docs/quickstart.md, docs/client-usage.md, and sdk-hook/docs/README.md updated from sdk-v-0.8.0.js to sdk-v-0.8.1.js
  • README's ## Version header + a new ### 0.8.1 highlights block above the existing 0.8.0 section
  • CHANGELOG.md 0.8.1 entry — re-framed after self-review to be explicit about what works without customer config (cleaner error message) vs what requires opt-in (transparent recovery)
  • New ## Refreshing an expired token (0.8.1+) section in docs/connect-access-token.md covering:
    • Why automatic recovery isn't possible (SDK secret key can't be in browser code, so the SDK can't mint tokens on its own)
    • Server-side refresh endpoint pattern with paste-ready Flask + Express snippets
    • The SDK-side connectAccessTokenRefreshFn wiring
    • Fallback for hosts that can't add a refresh endpoint (use onConnectAccessTokenExpired to prompt a reload)

Release blocked on companion verification

The /sdk-test sandbox is the end-to-end demonstration the docs reference. It needs the new connectAccessTokenRefreshFn wired against a server-side refresh endpoint before this release is honest about what it delivers. That companion change lives in the stream-side repo and is verified working locally; both need to merge before npm publish.

Release flow after merge

  1. npm install && npm run build in master (regenerates sdk.js + sdk-headless.js with VERSION = '0.8.1' baked in).
  2. npm publish (TTY required for the 2FA passkey).
  3. Follow-up: stream-side CDN bake for sdk-v-0.8.1.js (same pattern as the 0.8.0 bake — package.json versioned alias + webpack entry + thin wrapper JSX).

Test plan

  • CI green (tsc, biome check).
  • npm pack --dry-run shows the tarball at 0.8.1 with the rebuilt bundles.
  • After publish, npm view [email protected] resolves and the shasum matches the local pack.
  • The /sdk-test sandbox (companion stream change) demonstrates transparent refresh end-to-end.

Bumps `version` to 0.8.1, the `VERSION` constants in `SDK.tsx` and
`sdk-core.tsx` (these get baked into the build outputs and surface
in the console banner), and the CDN URL examples in
`docs/quickstart.md`, `docs/client-usage.md`, and
`sdk-hook/docs/README.md` to `sdk-v-0.8.1.js`.

CHANGELOG entry covers the new optional `connectAccessTokenRefreshFn`
+ `onConnectAccessTokenExpired` init options + the
`tpastream-connect-token-expired` window event. README's Version
header and highlights section get a 0.8.1 entry above the existing
0.8.0 block.

Strictly additive on the wire and at the init() call site;
integrations that don't opt into the new hooks see no behavior
change.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Straightforward 0.8.1 version bump release PR. Bumps version strings in package metadata and bundle constants, updates CDN URL examples in docs from 0.8.0 to 0.8.1, and adds README/CHANGELOG entries describing the new expired-token auto-recover feature from #101 (the behavior change itself is not in this diff).

Changes:

  • Version bump to 0.8.1 in package.json, package-lock.json, and the VERSION constants baked into the SDK bundles.
  • Documentation refresh (README highlights, CHANGELOG entry, CDN URL examples in quickstart/client-usage/sdk-hook README).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Bump version to 0.8.1.
package-lock.json Bump lockfile version to 0.8.1.
assets/sdk/entries/sdk-core.tsx Update VERSION constant to '0.8.1'.
assets/sdk/components/SDK.tsx Update VERSION constant to '0.8.1'.
README.md Add 0.8.1 entry under ## Version and a 0.8.1 highlights block.
CHANGELOG.md Add 0.8.1 entry describing the expired-token auto-recover feature.
docs/quickstart.md Bump pinned CDN URL example to sdk-v-0.8.1.js.
docs/client-usage.md Bump current pinned CDN URL and list 0.8.0 as previous pinned version.
sdk-hook/docs/README.md Bump CDN URL example to sdk-v-0.8.1.js.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CHANGELOG re-framed to be honest about what 0.8.1 delivers without
customer config (cleaner error message) versus what requires opt-in
(transparent auto-recover via `connectAccessTokenRefreshFn`, or
"session expired" UI via `onConnectAccessTokenExpired`). README's
0.8.1 header + highlights mirror the same framing.

New section in `docs/connect-access-token.md`:
"Refreshing an expired token (0.8.1+)" — covers the why (secret
key can't be in browser code, so the SDK can't mint tokens on its
own), a Flask example endpoint, an Express example, the SDK-side
`connectAccessTokenRefreshFn` wiring, and a fallback for hosts that
can't add a refresh endpoint (use `onConnectAccessTokenExpired` to
prompt the member to reload).
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

The Flask + Express snippets weren't representative of the actual
customer mix — a lot of integrations run on .NET. Adds an ASP.NET
Core example using `IHttpClientFactory` + `PostAsJsonAsync` and a
brief note that the pattern (authenticated POST proxying to
`app.tpastream.com/api/create-connect-token`) is the same in every
backend, with PHP/Ruby/Go/Java implied.
@fuhrysteve fuhrysteve merged commit 02463d1 into master May 18, 2026
2 checks passed
@fuhrysteve fuhrysteve deleted the fuhry/sdk-0.8.1 branch May 18, 2026 12:59
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.

2 participants