Skip to content

rickythefox/bankid-react-hook

Repository files navigation

useBankID React hook

npm version

A React hook for using the Swedish BankID.

  • Simplifies using the BankID API.
  • No dependencies
  • Polls using correct intervals - 1s for qr code, 2s for collect.
  • Supports animated QR code.
  • Includes mocked API, demo and tests.
  • Demo can be used to test a real API implementation

Adapt to your own backend implementation.

Running the demo

Uses vite for bundling, pnpm for package management.

pnpm install
pnpm dev

Testing

Uses vitest for testing and MSW for mocking the API.

pnpm test