Skip to main content

Detect Nightly

In order to detect Nightly Wallet in your solana app, we recommend you use the @wallet-standard/core package.

note

Before fetching detected wallets, install the package by running the following command in your terminal

# Using NPM
npm i @wallet-standard/core
# Using Yarn
yarn add @wallet-standard/core

After installing the package use this code to get access to all detected wallets.

import { getWallets } from '@wallet-standard/core'

const { get } = getWallets()
const allWallets = get()

Then, to filter out the wallets that aren't compatible with the solana standard.

import { isWalletAdapterCompatibleStandardWallet } from '@solana/wallet-adapter-base'

const solanaWallets = allWallets.filter(isWalletAdapterCompatibleStandardWallet)

Now, after finding the Nightly wallet in the solanaWallets object, you will have access to all of the functions such as connect, which we will talk about in the next section.


Accessing the nightly object is also possible by finding the nightly.solana object on the window.

const nightlySolana = window.nightly?.solana