@saganta/stellar-appkit
v1.9.46
Published
Unified Stellar wallet connections, Soroban, and transaction preview — the core SDK (no UI).
Downloads
8,060
Readme
@saganta/stellar-appkit
Unified Stellar wallet connections, Soroban, and transaction preview — the core SDK (no UI).
📖 Official Docs · 🎮 Official Demos
| | Link | |---|---| | 📖 Official Docs | stellar-appkit.saganta.com | | 🎮 Official Demos | demos.stellar-appkit.saganta.com | | 💻 GitHub | github.com/sagantaHQ/stellar-appkit |
Install
npm install @saganta/stellar-appkitQuick start
import {
StellarAppKit,
createFreighterConnector,
createAlbedoConnector,
} from '@saganta/stellar-appkit';
const appkit = new StellarAppKit({
network: 'TESTNET',
connectors: [createFreighterConnector(), createAlbedoConnector()],
appMetadata: {
name: 'My App',
url: 'https://app.example.com',
},
});
// Connect a wallet
const session = await appkit.connect('freighter');
// Sign a transaction
const { signedTxXdr } = await appkit.signTransaction(xdr);
// Sign a message (SIWS)
const { message, signedMessage, signedData, signerAddress } = await appkit.signIn({
statement: 'Sign in to My App',
nonce: 'server-issued-nonce',
});What's included
StellarAppKit— the core client. Manages wallet connections, sessions, signing queue, SIWS session lifecycle, and cross-tab sync.- Wallet connectors — Freighter, Albedo, xBull, Ledger, WalletConnect. All tree-shakeable — import only what you use.
defaultConnectors()— returns the 4 browser-side wallets (Freighter, Albedo, xBull, Ledger). WalletConnect is excluded (requiresprojectId).SorobanConnection— simulate → prepare → sign → submit as oneinvoke()call. Typed contract clients, RPC failover, fee estimation.- SIWS —
signIn()for manual sign-in, or pass aSiwsConfigfor automatic sign-in flow with session persistence. - i18n — 25 locales (English bundled, 24 lazy-loaded).
setLocale(),getLocale(),t(),onLocaleChange(). Networks—Networks.PUBLIC,Networks.TESTNET,Networks.FUTURENET,Networks.STANDALONE.
Framework wrappers
The core SDK is UI-free. For the modal UI + framework hooks:
npm install @saganta/stellar-appkit-ui-webFramework subpaths:
@saganta/stellar-appkit-ui-web/react— React hooks (useConnect,useSession,useSiwsSession,useLocale, etc.)@saganta/stellar-appkit-ui-web/vue— Vue 3 composables@saganta/stellar-appkit-ui-web/solid— Solid hooks@saganta/stellar-appkit-ui-web/svelte— Svelte stores
Server-side SIWS verification
npm install @saganta/stellar-appkit-siws-verifyimport { verifySiws } from '@saganta/stellar-appkit-siws-verify';
const result = await verifySiws(
{ message, signedMessage, signerAddress, signedData },
{ expectedDomain: 'app.example.com', expectedNonce: nonce }
);
if (result.ok) {
console.log(result.claims.address); // authenticated user
}Documentation
- Full docs — installation, quick start, API reference, guides
- Live demos — 18 working Next.js examples
- Changelog — release history
- AI Integration — SKILL.md + llms.txt for AI coding tools
License
MIT © Saganta
