Explore Snowball
No recent searches
No results found
Getting Started
Lit provides a simple way to integrate passkeys authentication into your application. This guide will walk you through the process of setting up user passkeys authentication with Lit.
First ensure you've installed the necessary packages:
npm install @snowballtools/js-sdk @snowballtools/auth-lit
Then initialize Snowball with passkey auth:
import { Snowball, SnowballChain } from '@snowballtools/js-sdk'
import { LitPasskeyAuth } from '@snowballtools/auth-lit'
const snowball = Snowball.withAuth({
passkey: LitPasskeyAuth.configure({
litRelayApiKey: 'your-lit-relay-api-key',
})
}).create({
apiKey: 'your-snowball-api-key',
initialChain: SnowballChain.sepolia
});
There are two key points you need to interact with passkey auth:
register(username)
authenticate
Note that these are functions on the snowball.auth.passkey
object, so you would access them like so:
snowball.auth.passkey.register('someUsername')
snowball.auth.passkey.authenticate()