Documentation
    Preparing search index...

    Module @mysten/enoki

    @mysten/enoki

    zkLogin authentication and sponsored transactions. Enable users to sign in with Google, Twitch, Facebook, and other OAuth providers, and execute transactions without gas fees.

    • zkLogin: Authenticate users with OAuth providers (Google, Twitch, Facebook)
    • Sponsored Transactions: Execute transactions without requiring users to hold gas
    • Wallet Integration: Register Enoki wallets with dApp Kit
    • Subname Management: Create and manage SuiNS subnames
    npm install @mysten/enoki
    
    import { registerEnokiWallets } from '@mysten/enoki';

    registerEnokiWallets({
    apiKey: 'your-enoki-api-key',
    providers: ['google', 'twitch', 'facebook'],
    });
    import { registerEnokiWallets } from '@mysten/enoki';
    import { useEnokiFlow } from '@mysten/enoki/react';

    // In your app setup
    registerEnokiWallets({
    apiKey: 'your-enoki-api-key',
    providers: ['google'],
    });

    // In your component
    function LoginButton() {
    const { login } = useEnokiFlow();

    return <button onClick={() => login('google')}>Sign in with Google</button>;
    }
    import { EnokiClient } from '@mysten/enoki';

    const client = new EnokiClient({
    apiKey: 'your-enoki-api-key',
    });

    // Create a sponsored transaction
    const sponsored = await client.createSponsoredTransaction({
    network: 'mainnet',
    sender: '0x...',
    transactionKindBytes: '...',
    });

    // Execute it
    await client.executeSponsoredTransaction({
    digest: sponsored.digest,
    signature: '...',
    });

    See the Enoki documentation for detailed setup and usage.

    Classes

    EnokiClient
    EnokiClientError
    EnokiFlow
    EnokiKeypair
    EnokiPublicKey

    Interfaces

    Encryption
    EnokiClientConfig
    EnokiWallet
    SyncStore

    Type Aliases

    AuthProvider
    EnokiFlowConfig
    EnokiNetwork
    RegisterEnokiWalletsOptions

    Functions

    createDefaultEncryption
    createInMemoryStorage
    createLocalStorage
    createSessionStorage
    enokiWalletsInitializer
    getSession
    getWalletMetadata
    isEnokiNetwork
    isEnokiWallet
    isFacebookWallet
    isGoogleWallet
    isTwitchWallet
    registerEnokiWallets