Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fellow/auth-browser

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fellow/auth-browser

A fork of the Capacitor Browser API only for iOS that supports extra features for authorization.

  • 5.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-76%
Maintainers
0
Weekly downloads
 
Created
Source

@fellow/authbrowser

The Auth Browser API provides the ability to open an in-app browser and subscribe to browser events.

On iOS, this uses ASWebAuthenticationSession and is compliant with leading OAuth service in-app-browser requirements.

on Android please use @capacitor/browser plugin.

Install

npm install @fellow/authbrowser
npx cap sync

Example

import { AuthBrowser } from '@fellow/authbrowser';

const LoginWithN = async (n: string) => {
    const result = await AuthBrowser.start({
		url: n,
		scheme: "myapp",
	});
    
	alert(JSON.stringify(result));
	if (result.success) {
		// Handle success, result.url should be defined
	} else {
        // Handle result.error
    }
};

API

  • start(...)
  • abort()
  • Interfaces
  • Type Aliases

start(...)

start(options: OpenOptions) => Promise<SuccessOrFailureResult>

iOS only: Open a page with the specified options.

Error on other platforms.

ParamType
optionsOpenOptions

Returns: Promise<SuccessOrFailureResult>

Since: 1.0.0


abort()

abort() => Promise<void>

iOS only: Close an open browser window.

Error on other platforms.

Since: 1.0.0


Interfaces

OpenOptions

Represents the options passed to open.

PropTypeDescriptionSince
urlstringThe URL to which the browser is opened.1.0.0
schemestringThe Scheme that the browser should listen to for to redirect back to the app. For example if you want to use the scheme myapp:// you would pass myapp.

Type Aliases

SuccessOrFailureResult

SuccessResult | FailureResult

SuccessResult

{ success: true; url: string; }

FailureResult

{ success: false; error: string; }

Keywords

FAQs

Package last updated on 24 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc