Connections

Authorize, encrypt, refresh, and revoke third-party credentials without moving provider APIs or product workflows into a generic abstraction.

Approaches

OAuth connections

Run purpose-bound PKCE authorization and keep encrypted provider credentials in user or account scope.

Packages

@playstack/connections

Frameworks and integrations

Named providers

Use GitHub, LinkedIn, Mastodon, and X drivers or the standards-based OAuth 2 factory.

Frameworks and integrations

AT Protocol sessions

Preserve official AT Protocol discovery, PAR, PKCE, DPoP, nonce, and session-store behavior.

Frameworks and integrations

Frameworks and integrations

integration

OAuth 2 providers

Configurable OAuth 2 credential lifecycle for provider APIs, separate from application login.

integration

LinkedIn

A packaged LinkedIn connection adapter with application-owned scopes and product operations.

integration

Mastodon

A packaged Mastodon connection adapter with explicit instance and credential ownership.

integration

X

A packaged X OAuth 2 connection adapter with explicit application permissions.

integration

GitHub

Connect OAuth credentials, GitHub App installation tokens, and verified webhook delivery through explicit Playstack boundaries.

integration

AT Protocol

Use the official AT Protocol OAuth client while keeping discovery, PAR, PKCE, DPoP, nonces, and session storage intact.

framework

Next.js

Compose Playstack server contracts, React bindings, SSR handoff, and route adapters at the Next.js application edge.

framework

NestJS

Connect portable Playstack capabilities to dependency injection, guards, decorators, request context, workers, and lifecycle hooks.

Package reference

@playstack/connections

Own credential lifecycle once

@playstack/connections provides purpose-bound OAuth state, PKCE, encrypted credential persistence, refresh serialization, and revocation. The core returns a valid access token while the application calls provider SDKs and owns product actions such as publishing, importing, or repository management.

ts
const connections = createConnections({
  persistence,
  crypto,
  events,
  clock,
  ids,
  providers: [github, mastodon, x],
  scope: 'account',
  redirectUri: 'https://app.example/api/connections/callback',
  returnUrlOrigins: ['https://app.example'],
})

GitHub, LinkedIn, Mastodon, and X have named providers. A standards-based OAuth 2 factory covers conventional authorization-code providers while preserving explicit identity lookup and native driver access.

Automatic refresh requires an explicitly nonrotating provider. When refresh is due, rotating or unclassified providers receive a fixed nonretryable refusal before credential decryption or provider submission; existing access outside the lead window remains available. Fresh reviewed authorization or an application's qualified durable integration or explicit native managed Node GitHub.com profile is the supported path. The latter adds permanent credential claims and target barriers, committed one-shot dispatch, encrypted response recovery and guarded installation; unknown outcomes never automatically replay or expire. Adopt its optional schema, narrow grants and required authorization/evidence callbacks before use. Custom providers/transports and live-provider qualification remain separate.

Stored credentials now carry an immutable commitment to their configured OAuth client, server and resource. Signed state and prepared grants carry the same binding, and already-exchanged admission requires the trusted exchange binding. Changed configuration refuses credential use before secrets are decrypted or sent; provider aliases cannot silently retarget a grant. Dedicated client-secret rotation preserves identity. Schema/provider adoption is explicit, without defaults, automatic backfill or rebinding. Generic resource declarations remain trusted application configuration, not endpoint attestation. This guard does not replace physical-target ownership, target-key hasher pinning or a durable refresh journal.

Respect unusual protocols

AT Protocol is not flattened into a bearer-token preset. @playstack/atproto wraps the official OAuth client so discovery, PAR, PKCE, DPoP keys and nonces, rotating refresh tokens, and shared session storage keep their native semantics.

Select persistence ownership

Playstack publishes user, account, and account-member Prisma variants. Mature applications can instead implement the portable persistence contract against an existing schema and keep identifier or table mappings application-owned.

Native persistence also retains an opaque ID reservation separately from live Connection rows. Committed IDs cannot be reused after record/owner deletion; known rollback removes provisional reservations, and saves require the witness. Adopt the current schema and custom-adapter contract together. Historical evidence is not fabricated or backfilled. This prevents same-ID resurrection through native ports; it does not add the cross-ID target journal needed for rotating refresh.

Go

Playstack Pro tag
OriginsPricingBlogChangelogStatus

© 2026 Playstack. All rights reserved.

With OSS

By

Commune Software