KiroroLabs Social-Native Auth & Web3 SDK for Threads + Multi-Chain
npm install @kirorolabs/sdk
bash
npm install @kirorolabs/sdk viem @solana/web3.js
or
yarn add @kirorolabs/sdk viem
`
Quick Start 🚀
$3
Create a project at app.kiroro.xyz/dashboard to get your kiroroClientId.
$3
`tsx
import { KiroroProvider } from '@kirorolabs/sdk';
function App() {
return (
);
}
`
$3
`tsx
import { useKiroroAuth, useKiroroWallet } from '@kirorolabs/sdk';
function MyComponent() {
// Authentication
const { user, isAuthenticated, login, logout } = useKiroroAuth();
// Wallet & Transactions
const { sendTransaction, writeContract, signMessage, isReady } = useKiroroWallet();
const handleSend = async () => {
const hash = await sendTransaction({
to: "0x1234...",
value: BigInt(1e16), // 0.01 ETH
});
console.log("Transaction:", hash);
};
if (!isAuthenticated) {
return ;
}
return (
Welcome, @{user.username}!
);
}
`
Hooks API 🪝
$3
`typescript
const {
user, // KiroroUser | null
isAuthenticated, // boolean
isLoading, // boolean
login, // () => void
logout, // () => void
getAccessToken, // () => Promise
} = useKiroroAuth();
`
$3
`typescript
const {
address, // Primary wallet address
smartWalletAddress,// ERC-4337 smart wallet
isReady, // Ready for transactions
chainId, // Current chain
// Transactions
sendTransaction, // (request) => Promise
writeContract, // (request) => Promise
// Signing
signMessage, // (message) => Promise
signTypedData, // (typedData) => Promise
// Chain
switchChain, // (chainId) => Promise
waitForTransaction,// (hash) => Promise
} = useKiroroWallet();
`
$3
`typescript
import { useKiroroSolana } from '@kirorolabs/sdk';
const {
connect, // () => Promise
signMessage, // (message) => Promise
sendTransaction, // (tx, connection) => Promise
walletAddress, // string | null
isConnected, // boolean
} = useKiroroSolana();
`
$3
`typescript
import { useKiroroToken } from '@kirorolabs/sdk';
const { balance, transfer, approve, allowance } = useKiroroToken("0xTokenAddress");
// Transfer tokens
await transfer("0xRecipient", BigInt(1e18));
`
$3
`typescript
import { useKiroroNFT } from '@kirorolabs/sdk';
const { balance, transfer, ownerOf } = useKiroroNFT("0xNFTContract");
// Transfer an NFT
await transfer("0xRecipient", BigInt(tokenId));
`
Wagmi Integration
`typescript
import { kiroroWagmiConnector } from '@kirorolabs/sdk/wagmi';
import { createConfig } from 'wagmi';
const config = createConfig({
connectors: [kiroroWagmiConnector()],
// ... rest of wagmi config
});
// Now standard Wagmi hooks work with Kiroro!
// useWriteContract(), useSendTransaction(), etc.
`
Types
`typescript
interface KiroroUser {
id: string;
threadsId: string;
username: string;
picture: string;
walletAddress?: string;
solanaWalletAddress?: string;
smartWalletAddress?: string;
eoaAddress?: string;
chainId?: number;
isVerified?: boolean;
}
interface SendTransactionRequest {
to: 0x${string};
value?: bigint;
data?: 0x${string};
}
interface WriteContractRequest {
address: 0x${string};
abi: TAbi;
functionName: string;
args?: readonly unknown[];
value?: bigint;
}
`
Configuration ⚙️
| Option | Type | Description |
| :--- | :--- | :--- |
| kiroroClientId | string | Required. Your API key from the dashboard |
| gasless | boolean | Enable sponsored transactions |
| chains | Chain[] | Supported chains (defaults to Base) |
| defaultChain | Chain | Default chain |
| appearance.theme | "dark" \| "light" | Theme for auth modal |
| appearance.logo | string` | Custom logo URL |