Skip to content

Conversation

hf
Copy link
Contributor

@hf hf commented Mar 17, 2025

Adds signInWithWeb3 which allows sign in with Solana.

Example usage

First connect to the user's wallet then:

const wallet = useWallet()

<Button onClick={() => {
  await supabase.auth.signInWithWeb3({ chain: 'solana', wallet, statement: "Custom message" })
}}>
  Sign in with Solana
</Button>

It also works without Wallet Standard, at least with Phantom, Solflare and Brave by reading the window.solana object or you can custom send a wallet object that satisfies the signIn() or signMessage() APIs.

Additionally you can sign the message yourself and send it via the raw API:

await supabase.auth.signInWithWeb3({
  chain: 'solana',
  message: 'supabase.com wants you to sign in with your Solana account:\n...',
  signature: signatureUint8Array,
})

@hf hf force-pushed the hf/web3 branch 2 times, most recently from 901d842 to 602c67e Compare March 18, 2025 12:14
@hf hf force-pushed the hf/web3 branch 3 times, most recently from 9dcf46d to 863c30c Compare April 2, 2025 13:16
@hf hf marked this pull request as ready for review April 2, 2025 13:18
@hf
Copy link
Contributor Author

hf commented Apr 4, 2025

As for tests, they'll come in a follow up PR because the DX needs to be proofed out once again in the RC.

@hf hf merged commit cff5bcb into master Apr 4, 2025
7 of 8 checks passed
@hf hf deleted the hf/web3 branch April 4, 2025 19:43
hf pushed a commit that referenced this pull request May 22, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.70.0](v2.69.1...v2.70.0)
(2025-05-16)


### Features

* add `signInWithWeb3` with solana
([#1037](#1037))
([cff5bcb](cff5bcb))
* validate uuid and sign out scope parameters to functions
([#1063](#1063))
([1bcb76e](1bcb76e))


### Bug Fixes

* add missing `deleted_at` property to `User` interface
([#1059](#1059))
([96da194](96da194))
* export `processLock` from toplevel
([#1057](#1057))
([d99695a](d99695a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
mandarini pushed a commit to supabase/supabase-js that referenced this pull request Oct 2, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.70.0](supabase/auth-js@v2.69.1...v2.70.0)
(2025-05-16)


### Features

* add `signInWithWeb3` with solana
([#1037](supabase/auth-js#1037))
([b6c241c](supabase/auth-js@b6c241c))
* validate uuid and sign out scope parameters to functions
([#1063](supabase/auth-js#1063))
([eb52bde](supabase/auth-js@eb52bde))


### Bug Fixes

* add missing `deleted_at` property to `User` interface
([#1059](supabase/auth-js#1059))
([bba6709](supabase/auth-js@bba6709))
* export `processLock` from toplevel
([#1057](supabase/auth-js#1057))
([ce9618e](supabase/auth-js@ce9618e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants