Repository navigation
v0.5.0
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 withPOST /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 newcustomdomain:token-expiredmessage), the SDK callsgetTokenand hands the result
back, so the widget refreshes silently instead of stopping. WithoutgetToken, 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.wwwRedirectfor root domains.trueconnects the root and
wwwand redirects the root towww;falseconnects the root alone; unset lets the end user
choose.customdomain-js:OpenConfig.onFallback, thecustomdomain:fallbackwindow event and the
FallbackDetailtype ({ 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_unsupportedorunknown_provider.customdomain-js:CheckDomainResultnow carries the control plane's rail verdict:
rails(aRailInfoof{ available, reason?, caveat? }foroauth,domainConnect,
apiKeyandmanual),recommendedRail,endUserAutomatic,blockedReason
(unregisteredorplatform_subdomain),dashboardUrlandnameservers, each mapped from its
snake_case wire name incheckDomain().supportsAutomaticonly ever meant that an adapter
exists for the provider;railssays whether each rail can run for this domain right now.
Changed
customdomain-js: errors the widget reports are now also dispatched as the
customdomain:errorwindow event,{ code, message, title?, details? }. The event was
documented, but a widget error used to reach onlyonError.customdomain-js: the init payload sent to the widget now includeswwwRedirectand
canRefreshToken(true whengetTokenis set).@customdomain/react: no source change. It depends oncustomdomain-js@0.5.0, so
getToken,wwwRedirectandonFallbackare accepted as props and passed to the SDK. Its
README now documentsonPurchaseandpurchaseDomain(), 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
getTokenandwwwRedirectare 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:errorand thecheckDomainrail fields
work with the hosted widget and API live today.
Full changelog: CHANGELOG.md · Diff: v0.4.1...v0.5.0