@multiplatform.one/gpg
v7.31.0
Published
Sign-In With GPG (SIWG) screen + GpgProvider for the connectkit modal — no viem
Downloads
5,665
Readme
@multiplatform.one/gpg
Sign-In With GPG (SIWG) for the multiplatform.one connectkit modal — a
connection-free signer where the user signs a challenge in their terminal and
pastes the result back. Pulls in no wagmi/viem: it depends only on
@multiplatform.one/connectkit, so a GPG-only app can skip the wallet stack.
Install
pnpm add @multiplatform.one/gpg @multiplatform.one/connectkitPeers: react, @tanstack/react-query.
What it owns
GpgProvider— GPG auth state + challenge/nonce lifecycle (GPG_NONCE_QUERY_KEY)useGpg()— status, sign-in/sign-out actions (GpgStatusState)SignInWithGpg/SignInWithGpgButton(aliasGPGButton) — drop-in sign-in surface and trigger buttongpgScreen,GpgScreenRegistrar,GpgBridge— registers the GPG screen into the connectkit modal's screen registry
What it must not do
- No blockchain wallets, no viem/wagmi — wallet signers live in
@multiplatform.one/web3 - No modal shell of its own — it registers screens into
@multiplatform.one/connectkit
Usage
import { ConnectKitProvider } from "@multiplatform.one/connectkit";
import { GpgBridge, GpgProvider, SignInWithGpgButton } from "@multiplatform.one/gpg";
export function App() {
return (
<GpgProvider getNonce={getNonce} onSign={onSign} buildMessage={buildMessage}>
<ConnectKitProvider bridge={GpgBridge}>
<SignInWithGpgButton />
</ConnectKitProvider>
</GpgProvider>
);
}buildMessage is the challenge the user signs; this package has no builder of
its own. Pass buildWalletMessage("gpg", { nonce }) from
@multiplatform.one/web3/message, or use web3's GpgProvider, which defaults
to it. GpgProvider must wrap outside ConnectKitProvider. In an app that also
ships wallets, @multiplatform.one/web3 mounts GpgScreenRegistrar alongside
its own screens instead of GpgBridge.
License
Apache-2.0
