Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 26 Sep 19:01

Published to npm as customdomain-js@0.5.0 and @customdomain/react@0.5.0, with provenance.

Ported byte identical from the product monorepo's packages/sdk/src and packages/react/src.
Everything here is additive: no type was removed or narrowed.

Added

  • customdomain-js: OpenConfig.getToken, a function that returns a fresh widget token
    (mint it on your server with POST /v1/tokens). Widget tokens last about 15 minutes, and a user
    adding DNS records by hand often takes longer. When the widget reports that its token expired
    (the new customdomain:token-expired message), the SDK calls getToken and hands the result
    back, so the widget refreshes silently instead of stopping. Without getToken, or if it throws
    or returns nothing, the SDK answers at once and the widget tells the user they can close the
    window; the connection still finishes on its own once the records appear.
  • customdomain-js: OpenConfig.wwwRedirect for root domains. true connects the root and
    www and redirects the root to www; false connects the root alone; unset lets the end user
    choose.
  • customdomain-js: OpenConfig.onFallback, the customdomain:fallback window event and the
    FallbackDetail type ({ reason, provider?, screen?, message? }). They fire when the widget
    sends the user to copy records by hand instead of a one-click or sign-in flow, and say why:
    no_end_user_rail, conflicts_exceed_tolerance, provider_unsupported or unknown_provider.
  • customdomain-js: CheckDomainResult now carries the control plane's rail verdict:
    rails (a RailInfo of { available, reason?, caveat? } for oauth, domainConnect,
    apiKey and manual), recommendedRail, endUserAutomatic, blockedReason
    (unregistered or platform_subdomain), dashboardUrl and nameservers, each mapped from its
    snake_case wire name in checkDomain(). supportsAutomatic only ever meant that an adapter
    exists for the provider; rails says whether each rail can run for this domain right now.

Changed

  • customdomain-js: errors the widget reports are now also dispatched as the
    customdomain:error window event, { code, message, title?, details? }. The event was
    documented, but a widget error used to reach only onError.
  • customdomain-js: the init payload sent to the widget now includes wwwRedirect and
    canRefreshToken (true when getToken is set).
  • @customdomain/react: no source change. It depends on customdomain-js@0.5.0, so
    getToken, wwwRedirect and onFallback are accepted as props and passed to the SDK. Its
    README now documents onPurchase and purchaseDomain(), which closes the known gap noted
    under 0.4.0, along with the new props.
  • Both packages: descriptions and READMEs use the CustomDomain™ brand, and every README ends
    with the same support and license sections.

Compatibility

  • getToken and wwwRedirect are read by the hosted widget that ships with the next CustomDomain™
    product release. A hosted widget without that support ignores both, so setting them now is safe.
    onFallback, customdomain:fallback, customdomain:error and the checkDomain rail fields
    work with the hosted widget and API live today.

Full changelog: CHANGELOG.md · Diff: v0.4.1...v0.5.0