Socket
Book a DemoInstallSign in
Socket

@thangved/callback-window

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thangved/callback-window

A simple handler for external website window callback

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

Callback window

A simple handler for external website window callback

Install

Install this package via npm

npm i @thangved/callback-window

Or via yarn

yarn add @thangved/callback-window

Usage

import { startCallbackWindow } from '@thangved/callback-window';

const handleCallback = async () => {
  try {
    const { redirectedUrl } = await startCallbackWindow(
      'https://redirect.thangved.com/?redirect_uri=https://profile.thangved.com',
    );

    console.log(redirectedUrl); // https://profile.thangved.com
  } catch (error) {
    console.log(error);
  }
};

Options

OptionTypeDefaultDescription
timeoutnumberInfinityTime to close window in milliseconds
intervalnumber100Time to check current URL in milliseconds
shouldClose(currentUrl: string) => boolean | Promise<boolean>The window checker should be closed. By default, the window will close when the origin of the window equals the origin of the parent window
onBrowserNotAllowed(url: string) => voidWhat to do when the browser does not allow opening new windows; by default changes the current window address to the destination address

Keywords

js

FAQs

Package last updated on 12 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts