Skip to content

openOAuthPopup()

@blobs/sdk v0.1.0


@blobs/sdk / utils/oauthHelpers / openOAuthPopup

openOAuthPopup(url, state, providerId, options?): Window | null

Defined in: utils/oauthHelpers.ts:72

Open the provider’s authorization URL in a centered popup window.

Persists the OAuth state to localStorage and starts polling for the popup’s result if any of the result callbacks are provided.

Parameters

url

string

Provider authorization URL.

state

string

Random state token (also persisted for validation).

providerId

string

Storage provider being authorized.

options?

OAuthPopupOptions = {}

Popup sizing and result callbacks.

Returns

Window | null

The popup window handle, or null if the browser blocked it.