Advanced Usage
Additional guides and info for more advanced use cases
Manual authentication
"use client";
import { useWallet } from "@solana/wallet-adapter-react";
import { TorqueProvider } from "@torque-labs/react";
/**
* Pass the wallet to the TorqueProvider.
*/
const TorqueContext = ({ children }: PropsWithChildren) => {
const { wallet } = useWallet();
const options = {
apiUrl: "https://server.torque.so",
rpcUrl: "<MAINNET RPC URL>,
authDomain: "<YOUR APP URL>",
}
return (
<TorqueProvider
wallet={wallet?.adapter}
autoConnect={false} // Disables auto-initialize
options={options}
callbacks={{
onAuthenticated: (user) => {
// code here
},
onLogout: () => {
// code hhere
}
}}
>
{children}
</TorqueProvider>
);
};Connecting to X/Twitter
Last updated