Choosing sign-in methods
sigport ships nine adapters. Their ids:
| id | Signs in with |
|---|---|
extension | A browser extension (NIP-07): Alby, nos2x, Keys.band… |
remote | A signer on another device (NIP-46): Amber, Primal, Nsec.app… |
metamask | MetaMask, through a Snap that holds a Nostr key |
onekey | The OneKey wallet |
okx | OKX Wallet |
passkey | The device's screen lock (WebAuthn PRF) |
local | A new key made here and encrypted with a password |
readonly | Someone's public key; signs nothing |
guest | A 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:
<sigport-signin exclude="okx,onekey,metamask"></sigport-signin>In code:
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:
<sigport-signin include="extension,remote,passkey"></sigport-signin>In code, import each adapter:
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:
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:
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:
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.