Skip to main content

Detect Nightly

In order to detect Nightly Wallet in your aptos app we recommend you use the @aptos-labs/wallet-standard package (source code https://github.com/aptos-labs/wallet-standard), like so.

note

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

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

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

import { getAptosWallets } from '@aptos-labs/wallet-standard'

const wallets = getAptosWallets()
const aptosWallets = wallets.aptosWallets

Now, after finding the Nightly wallet in the aptosWallets 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.aptos object on the window.

const nightlyAptos = window.nightly?.aptos