npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@phantom/wallet-sdk

v0.0.12

Published

Phantom Embedded enables you to seamlessly onboard users to your application, without requiring them to have previously installed a wallet. With Phantom Embedded, users can create a self custodial wallet with just their Google account and a 4-digit pin. O

Downloads

714

Readme

Phantom Embedded Wallet SDK

Phantom Embedded enables you to seamlessly onboard users to your application, without requiring them to have previously installed a wallet. With Phantom Embedded, users can create a self custodial wallet with just their Google account and a 4-digit pin. Once created, this wallet will automatically sync with Phantom's mobile and extension apps without the user needing to know their seed phrase or manage any private keys.

In addition to powering wallet creation, Phantom Embedded also comes with a built-in UI for users to view and manage their holdings. This UI serves as a trusted interface for users to sign messages and transactions on your app.

Features

  • Create self custodial wallets without leaving your application
  • Onboard users via Sign in with Google and a 4-digit pin (no seed phrases)
  • Sync embedded wallets with Phantom's mobile and extension apps
  • Sign transactions and message on Solana (more chains coming soon)
  • View, send, and receive tokens on Solana, Ethereum, Bitcoin, Base, and Polygon
  • Pricing: FREE

Quickstart

  1. Install the Phantom Embedded SDK
yarn | npm | pnpm add @phantom/wallet-sdk
  1. Load the Phantom Embedded wallet in your web application
import {createPhantom} from "@phantom/wallet-sdk"

const opts: CreatePhantomConfig = {
    zIndex: 10_000,
    hideLauncherBeforeOnboarded: true,
}

const App = () => {
    useEffect(() => {
        createPhantom(opts);
    }, []);
...
}
  1. Integrate Phantom as you would normally. Whenever a user interacts with Phantom (e.g. window.phantom.solana.connect()), the Phantom Embedded wallet will automatically initialize if the user does not have Phantom already installed.

Configuration

The following optional parameters can be passed as createPhantom({options...}) to customize the Phantom Embedded wallet experience.

| Parameter | Type | Description | | ----------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | hideLauncherBeforeOnboarded | boolean | If true, the Phantom Embedded UI will be hidden until the user engages with Phantom. Defaults to false. | | colorScheme | string | The background color of the Phantom Embedded iframe, which should be configured to match your site's theme. Can be "light", "dark", or "normal". Defaults to "normal". | | zIndex | number | The z-index of the Phantom Embedded UI. Defaults to 10_000. | | paddingBottom | number | The number of pixels between the Phantom Embedded UI and the right edge of the web. Defaults to 0. | | paddingRight | number | The number of pixels between the Phantom Embedded UI and the bottom edge of the web. Defaults to 0. | | paddingTop | number | The number of pixels between the Phantom Embedded UI and the top edge of the web. Defaults to 0. | | paddingLeft | number | The number of pixels between the Phantom Embedded UI and the left edge of the web. Defaults to 0. | | position | enum | The corner of the app where the Phantom wallet will be displayed. Can be "bottom-right", "bottom-left", "top-right", "top-left". Defaults to "bottom-left". |

See It In Action

Try out Phantom Embedded via our demo app: https://sandbox.phantom.dev/sol-embedded-sandbox

Note: Phantom Embedded will not initialize if it detects that the user already has the Phantom extension installed, or if the user is accessing the page from within the Phantom mobile app.

Give Feedback

Phantom Embedded is in active development and will be prioritizing features requested by early adopters. If you are interested in working with us, please email us at [email protected] or message @brianfriel on Telegram.

Frequently Asked Questions

If the Phantom extension is detected, we will not inject the embedded wallet. Phantom users can continue using their extension like normal.
The Phantom embedded wallet lives inside an iframe. The `createPhantom` function loads and attaches the iframe to your website.
Once `createPhantom` has been called, `window.phantom.solana` and a compliant wallet-standard provider will also be available in the global scope of your website. This means that most of your existing code for interacting with Solana wallets should work out of the box.

Once a user has onboarded to the embedded wallet, they should be able to click your “connect wallet” button, which gives your website access to their Solana address. After that, signing messages and transactions should just work as normal.
The most common cause is that you are using a browser with the Phantom extension installed. If the Phantom extension is detected, we will not inject the embedded wallet.

You can temporarily disable the Phantom extension by going to `chrome://extensions` and toggling Phantom off.
It's free!

Disclaimers

We are providing early access to beta software for testing purposes only. Embedded wallet should be used in a non-production environment only. Phantom will not be liable for any losses or damages suffered by you or your end users if you push the early access version of embedded wallets to a production environment.

All suggestions, enhancement requests, recommendations or other feedback provided by you relating to the embedded wallet will be the sole and exclusive property of Phantom and by using the early access version of embedded wallets and providing feedback to Phantom you agree to assign any rights in that feedback to Phantom.