npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@powenscompany/webview-js

v0.1.0

Published

This web component allows you to quickly and easily implement aggregation journeys and integrate the Powens Webview in your JavaScript & TypeScript projects.

Readme

Powens Webview JS

This web component allows you to quickly and easily implement aggregation journeys and integrate the Powens Webview in your JavaScript & TypeScript projects.

Installation

From npm

Run the following command to add this package to your package.json.

npm install --save @powenscompany/webview-js

Manually

Download powens-webview.js & powens-webview.d.ts from the lib/ folder and add them to your project.

Usage

General usage

Load the web component

<script type="module" src="powens-webview.js"></script>

Use it in your HTML

<powens-webview/>

Open the Webview

import PowensWebviewElement, { PowensWebviewFlow, PowensWebviewLanguage, PowensWebviewMessage } from '@powenscompany/webview-js/powens-webview';

// Get `<powens-webview>` element reference
const powensWebview = document.querySelector('powens-webview') as PowensWebviewElement;

// Configure Webview and opening parameters
powensWebview.options = {
  flow: PowensWebviewFlow.Connect, // ‘connect’
  domain: 'domain.biapi.pro',
  clientId: ‘2307407’,
  redirectUri: window.location.origin,
  lang: PowensWebviewLanguage.English, // ‘en’
  code: 'COj_wSfkqm1rpS8UYFMCK481VVCv1xy8YZu...zSerIrMZyRBIQPWQlXgPuY0Z/7F0Ig6Gvuw',
  maxConnections: 3,
  connectorCapabilities: ['bank', 'bankwealth', 'document'],
  accountTypes: ['card', 'checking', 'market', 'perco'],
  // [...]
};

// Open the Webview
powensWebview.openWebview();

See the types reference below for a complete example of setting parameters.

Handle the Webview completion event

window.addEventListener('message', (event: MessageEvent<PowensWebviewMessage>) => {
  if (event.origin !== window.origin) return;
  if (event.data.type !== 'powensWebviewTermination') return;

  const powensResult = event.data.data;
  console.log(powensResult);
  const connectionId = powensResult.connectionId;
  // Do what you must with the Webview callback data
});

Make sure to remove the event listener when no longer needed.

Angular

Load the web component by importing it in angular.json

"architect": {
  "build": {
    "options": {
      "scripts": [
        {
          "input": "./node_modules/@powenscompany/webview-js/powens-webview.js",
          "inject": false,
          "bundleName": "powens-webview"
        }
      ]
    }
  }
}

React

Declare the powens-webview custom element to be able to use it in your JSX & TSX code

import PowensWebviewElement from '@powenscompany/webview-js/powens-webview';

declare global {
  namespace JSX {
    interface IntrinsicElements {
      ['powens-webview']: CustomElement<PowensWebviewElement>;
    }
  }
}

Types reference

For more information about Webview flows, parameters and callback parameters, please check our documentation.

PowensWebviewFlow

The list of available flows

export declare enum PowensWebviewFlow {
  Connect = "connect",
  Reconnect = "reconnect",
  Manage = "manage",
  Payment = "payment"
}

PowensWebviewLanguage

The list of supported languages

export declare enum PowensWebviewLanguage {
  English = "en",
  French = "fr",
  German = "de",
  Dutch = "nl",
  Italian = "it",
  Spanish = "es",
  Portuguese = "pt"
}

PowensWebviewOptions

The Webview configuration object

export interface PowensWebviewOptions {
  flow: PowensWebviewFlow;
  domain: string;
  clientId: string;
  lang?: PowensWebviewLanguage;
  code?: string;
  redirectUri?: string;
  maxConnections?: number;
  connectorUuids?: string[];
  connectorCapabilities?: string[];
  connectorCountry?: string;
  connectorFieldValues?: Record<string, Record<string, string>>;
  accountTypes?: string[];
  accountUsages?: string[];
  accountIbans?: string[];
  state?: string;
  connectionId?: number;
  resetCredentials?: true;
  sources?: string[];
  paymentId?: number;
}

Example

powensWebview.options = {
  flow: PowensWebviewFlow.Connect,
  domain: 'domain.biapi.pro',
  clientId: ‘2307407’,
  redirectUri: window.location.origin,
  lang: PowensWebviewLanguage.English,
  code: 'COj_wSfkqm1rpS8UYFMCK481VVCv1xy8YZu...zSerIrMZyRBIQPWQlXgPuY0Z/7F0Ig6Gvuw',
  maxConnections: 3,
  connectorUuids: [
    '338178e6-3d01-564f-9a7b-52ca442459bf',
    '07d76adf-ae35-5b38-aca8-67aafba13169',
    '37bbb26d-d371-5333-bcea-1839b5283cec',
  ],
  connectorCapabilities: ['bank', 'bankwealth', 'document'],
  connectorCountry: 'gb',
  connectorFieldValues: {
    '338178e6-3d01-564f-9a7b-52ca442459bf': {
      openapiwebsite: 'par',
      directaccesswebsite: 'pro'
    },
    'f5c29767-1bc8-5337-9e4e-68a0fbd91c9a': {
      website: 'pro'
    },
  },
  accountTypes: ['card', 'checking', 'market', 'perco'],
  accountUsages: ['priv', 'orga'],
  accountIbans: ['FR7610107001011234567890129', 'FR7611315000011234567890138'],
  state: 'MY_STATE',
  connectionId: 46,
  resetCredentials: true,
};

PowensWebviewResult

Outcoming Webview parameters upon completion, closure or failure

export interface PowensWebviewResult {
  connectionId?: number;
  connectionIds?: number[];
  connectionDeleted?: boolean;
  code?: string;
  state?: string;
  error?: string;
  errorDescription?: string;
}

License

Powens Webview JS is available under the LGPLv3 license. See the LICENSE file for more information.