Skip to content

Choosing sign-in methods ​

sigport ships nine adapters. Their ids:

idSigns in with
extensionA browser extension (NIP-07): Alby, nos2x, Keys.band…
remoteA signer on another device (NIP-46): Amber, Primal, Nsec.app…
metamaskMetaMask, through a Snap that holds a Nostr key
onekeyThe OneKey wallet
okxOKX Wallet
passkeyThe device's screen lock (WebAuthn PRF)
localA new key made here and encrypted with a password
readonlySomeone's public key; signs nothing
guestA throwaway key, gone when the tab closes

You can offer all of them, all but some, or only the ones you name.

All, minus some ​

With attributes:

html
<sigport-signin exclude="okx,onekey,metamask"></sigport-signin>

In code:

ts
import { createSigport } from '@sigport/core';
import { all } from '@sigport/core/all';

const sigport = createSigport({ adapters: all({ exclude: ['okx', 'onekey', 'metamask'] }) });

Only the ones you name ​

With attributes:

html
<sigport-signin include="extension,remote,passkey"></sigport-signin>

In code, import each adapter:

ts
import { createSigport } from '@sigport/core';
import { extension } from '@sigport/core/adapters/extension';
import { remote } from '@sigport/core/adapters/remote';
import { passkey } from '@sigport/core/adapters/passkey';

const sigport = createSigport({ adapters: [extension(), remote(), passkey()] });

Keeping the rest out of your bundle ​

@sigport/elements/define builds its default session from all(), so it brings every adapter with it. To ship only the adapters you import, register the elements from the main entry and give the panel your session:

ts
import { SigportButton, SigportSignIn } from '@sigport/elements';

customElements.define('sigport-signin', SigportSignIn);
customElements.define('sigport-button', SigportButton);

document.querySelector('sigport-signin')!.sigport = sigport;

The framework wrappers load @sigport/elements/define, so with them every adapter is bundled even when you pass a session.

Then hand the session to the panel:

js
document.querySelector('sigport-signin').sigport = sigport;

createSigport also accepts include and exclude, which filter whatever adapters you give it.

Options per adapter ​

Options go to the adapter's factory, or to all() under the adapter's id:

ts
all({
  metamask: { snapId: 'npm:@example/nostr-snap' },
  remote: { relays: ['wss://relay.nsec.app'] },
  passkey: { rpName: 'My app' },
  local: { minPassword: 16 },
  guest: { label: 'Try the demo' },
});

Every option is listed on Built-in adapters.

How the list is ordered ​

sigport reads the page once, without prompting, and orders the rows to suit the person:

  • A signing extension is installed. They already have an identity, so the extension and the remote signer lead, followed by any detected wallets.
  • A wallet but no extension. The wallets lead, then a passkey and the guest key.
  • Nothing. A newcomer is offered a passkey first, then looking around and creating a key.

The extension row always stays in the list. When no extension is installed, clicking it opens a list of extensions to get. Anything else that can't be used here moves behind Other sign-in options, with a link to download it or to read why it doesn't work.

To change the order, pass plan to createSigport. See the API reference.

MIT licensed.