Picket Docs
  • ๐Ÿ‘‹Welcome to Picket
  • Quick Start Guides
    • ๐Ÿš€Quick Start Guides
      • โš™๏ธStart Here: Setup
      • ๐Ÿ”Wallet Login
      • ๐Ÿช™Token Gating (Ethereum / EVM)
      • ๐ŸคบToken Gating (Solana)
      • ๐Ÿคนโ€โ™‚๏ธIncremental Token Gating
      • โ›”Restrict Access to Specific Wallets
      • ๐Ÿ”‘Working with Access Tokens
  • Reference
    • ๐ŸŽ“Concepts
      • ๐ŸŒŠAuth Flow
      • ๐Ÿ—ƒ๏ธConnect
      • โœ๏ธSignatures
      • ๐Ÿ”Authentication and Authorization
      • ๐ŸคนIncremental Authorization
      • ๐Ÿช™Access Tokens
      • ๐ŸงชTesting
      • โ‰๏ธErrors
      • โ›“๏ธSupported Blockchains
      • ๐ŸŒSupported Languages (Localization)
      • ๐ŸŽจModal Themes
      • ๐Ÿ’ฟOpen Source Web3 Client Libraries
    • ๐Ÿ“šLibraries and SDKs
      • Javascript Library - picket-js
      • React SDK - picket-react
      • Node.js Library - picket-node
      • Go Library - picket-go
      • Python Library - picket-python
    • ๐Ÿ”ฅIntegrations
      • ๐ŸŒˆPicket Authentication with RainbowKit
      • โšกSupabase
      • โ˜๏ธAmazon Cognito
      • ๐Ÿ›๏ธPicket Shopify App - Merchant Documentation
      • ๐Ÿ›’Picket BigCommerce App - Merchant Documentation
    • ๐Ÿ“–API Reference
      • Projects & API Keys
      • Auth
      • Chains
      • Wallets
      • Contracts
      • OAuth 2.0
  • ๐Ÿ•น๏ธTutorials
    • ๐ŸŒŽSign-In with Wallet (React)
    • ๐ŸฐToken Gated Photo Board (React)
    • ๐Ÿ”—Link a Wallet to a Web 2.0 Account
    • ๐ŸคIncremental Authorization (React)
Powered by GitBook
On this page
  • Connect Method
  • When to Use
  • Anatomy of a Connect Response
  • Supported Wallets
  • EVM-Compatible Chains
  • Solana
  1. Reference
  2. Concepts

Connect

Connecting wallets and picket wallet objects

PreviousAuth FlowNextSignatures

Last updated 2 years ago

Connect Method

Picket client SDKs contain a convenience method for connecting to wallets

// default is the Ethereum mainnet
picket.connect();
// you can also pass the "ethereum" explicitly
// picket.connect({ chain: "ethereum" });
picket.connect({ chain: "solana" });

picket.connect() triggers a wallet connection request which involves a pop up and/or redirect that will ask users to connect to any supported wallet of a .

It also triggers a picket compatible request for you that leverages a secure picket generated nonce.

Once the user connects their wallet and signs the message, you will receive a response with a Picket wallet object that contains the walletAddress, signature and provider which can be used for future on-chain operations with your of choice.

When to Use

picket.login() handles calling the picket.connect() function for you. So, if you're using picket.login() you don't need to manually call picket.connect() However, if you want to have access to a wallet for future on chain operations then the picket.connect() method is an easy and convenient way to accomplish that. You can use it alongside picket.login() like so:

import Picket from "@picketapi/picket-js"
const picket = new Picket('YOUR_PUBLISHABLE_KEY_HERE')

const { walletAddress, signature, provider } = await picket.connect()
const { accessToken } = await picket.login({ walletAddress, signature })

By using the connect() method here, you not only authenticate the wallet, you can also now use provider for future on chain interactions. For example, in order to get the wallet balance of the connected wallet you can do the following using the ethers.js library.

import { ethers } from "ethers";

const wallet = new ethers.providers.Web3Provider(provider);
const signer = wallet.getSigner();
await signer.getBalance()

Anatomy of a Connect Response

{
    address: "0x...abc",
    signature: "0xSignature",
    provider: {providerObject},
    // only returned when signing a SIWE-formatted message
    context: {
        domain: "example.com",
        uri: "https://example.com/login",
        chainID: 137,
        issuedAt: "2022-06-10T12:14:28Z"
    },
}
Property
Description

address

The connected walletAddress

signature

provider

context

The signing context for SIWE messages. This is needed to allow the server to verify the message signature.

Supported Wallets

EVM-Compatible Chains

While you can pass in a walletAddress and signature signed by any wallet. Currently picket.connect() makes over 100 wallets available to users via the convenient ready-built Picket connect UI. These include:

  • Metamask (And any browser injected wallet)

  • Coinbase Wallet

Solana

A valid picket signed by the wallet

A ethers.js and web3.js compatible wallet provider object that can be used to facilitate on-chain operations via these .

(Rainbow, Trust, Gnosis Multisig, Crypto.com, etc.)

If there is a wallet, or wallet standard you would like supported let us know: .

You can also build your own UI to let users select a wallet to connect to and/or use an open source 3rd party UI for this like . You can then follow the in order to use picket to verify ownership of the wallet and enable token gating.

On Solana, picket.connect() currently supports the and .

If there is a Solana wallet, or wallet standard you would like supported let us know: .

๐ŸŽ“
๐Ÿ—ƒ๏ธ
Wallet Connect Compatible Wallets
team@picketapi.com
Web3Modal
manual signing auth flow
Phantom Wallet
Solflare Wallet
team@picketapi.com
signature
open source libraries
picket supported blockchain
signature
web3 library