/auth
Search
K
Comment on page

connect

This function allows a user to connect their wallet to the site with three lines of code.

Usage

import React from 'react';
import { useSlashAuth } from '@slashauth/slashauth-react';
export const Connect = () => {
const { connect } = useSlashAuth();
return <button onClick={() => connect()}>Connect</button>;
}

Return Value

string | void

Configuration

transparent

Setting to true attempts to connect the wallet silently. Setting to false pops open the modal and allows the user to connect a wallet to the dApp. Note: This purely connects and does not sign-in.
import React from 'react';
import { useSlashAuth } from '@slashauth/slashauth-react';
export const Connect = () => {
const { connect } = useSlashAuth();
return <button onClick={() => connect(true)}>Connect</button>;
};