Get up and running with Sead SimpleSDK in 5 minutes!
No NPM, no dependencies, no build process. Just one JavaScript file and you're ready to go!
Contact Sead and receive:
sead-simple-api-bundle.js
abc123...xyz789.123def...890xyz
https://b2bapi.sead.world/api/v1
✅ That's it! No NPM, no dependencies, no build process.
Just one line in your HTML:
<!DOCTYPE html>
<html>
<head>
<title>My Wallet</title>
</head>
<body>
<!-- Your wallet UI here -->
<!-- Add SimpleSDK (just one line!) -->
<script src="sead-simple-api-bundle.js"></script>
<!-- Your code -->
<script src="quickstart.js"></script>
</body>
</html>
Create quickstart.js and paste:
// ===== QUICKSTART: Complete Working Example =====
// 1. Your credentials from Sead
const SEAD_API_KEY = 'your-api-key-here'; // Replace with your key
const SEAD_API_URL = 'https://b2bapi.sead.world/api/v1';
// 2. Initialize SDK (do this once per user)
function initSDK(userId) {
return new SeadSimpleWithAPI({
apiUrl: SEAD_API_URL,
apiKey: SEAD_API_KEY,
userId: userId // Required: consistent ID per user
});
}
// 3. Backup function - IT'S THIS SIMPLE!
async function backupWallet() {
try {
const seedPhrase = prompt('Enter your seed phrase:');
const userId = 'user_' + Date.now(); // Better: use wallet address
const sead = initSDK(userId);
// Create backup - THAT'S IT!
const result = await sead.backup({
seedPhrase: seedPhrase
// Optional: n: 5, m: 3, password: 'secret'
});
if (result.success) {
console.log('✅ Backup successful!');
result.shares.forEach((share, i) => {
console.log(`Share ${i + 1}:`, share.text);
displayQR(share.qrCode, i + 1);
});
}
} catch (error) {
console.error('Backup failed:', error);
}
}
// 4. Restore function - EQUALLY SIMPLE!
async function restoreWallet() {
try {
const share1 = prompt('Enter share 1:');
const share2 = prompt('Enter share 2:');
const sead = initSDK('restore_temp');
// Restore - THAT'S IT!
const result = await sead.restore({
shareTexts: [share1, share2]
// Optional: password: 'secret'
});
if (result.success) {
console.log('✅ Restored:', result.seedPhrase);
alert('Wallet restored: ' + result.seedPhrase);
}
} catch (error) {
console.error('Restore failed:', error);
}
}
// 5. Helper to display QR codes
function displayQR(qrBase64, shareNumber) {
const img = document.createElement('img');
img.src = qrBase64;
img.style.width = '200px';
img.style.margin = '10px';
img.title = `Share ${shareNumber}`;
document.body.appendChild(img);
}
Add this to your HTML body:
<!-- Quick UI -->
<div style="padding: 20px; font-family: Arial;">
<h1>Wallet Backup Demo</h1>
<button onclick="backupWallet()"
style="padding: 10px 20px; background: #4CAF50;
color: white; border: none; cursor: pointer;">
🔐 Backup Wallet
</button>
<button onclick="restoreWallet()"
style="padding: 10px 20px; background: #2196F3;
color: white; border: none; cursor: pointer;
margin-left: 10px;">
♻️ Restore Wallet
</button>
<div id="results" style="margin-top: 20px;"></div>
</div>
test seed phrase for demo
🎉 Congratulations!
You've integrated Sead's wallet backup solution!
Here's the entire integration in one file:
<!DOCTYPE html>
<html>
<head>
<title>SimpleSDK QuickStart</title>
</head>
<body>
<h1>Sead Backup - 5 Minute Demo</h1>
<button onclick="backup()">Backup</button>
<button onclick="restore()">Restore</button>
<div id="output"></div>
<!-- SimpleSDK -->
<script src="sead-simple-api-bundle.js"></script>
<script>
// Your API credentials
const sdk = new SeadSimpleWithAPI({
apiUrl: 'https://b2bapi.sead.world/api/v1',
apiKey: 'your-api-key',
userId: 'demo-user-001'
});
// Backup
async function backup() {
const result = await sdk.backup({
seedPhrase: 'your twelve word seed phrase'
});
if (result.success) {
document.getElementById('output').innerHTML =
result.shares.map(s =>
`<img src="${s.qrCode}" width="150">`
).join('');
}
}
// Restore
async function restore() {
const shares = prompt('Enter 2 shares (comma separated):').split(',');
const result = await sdk.restore({
shareTexts: shares
});
if (result.success) {
alert('Restored: ' + result.seedPhrase);
}
}
</script>
</body>
</html>
async function productionBackup(seedPhrase, userId) {
const sead = new SeadSimpleWithAPI({
apiUrl: 'https://b2bapi.sead.world/api/v1',
apiKey: process.env.SEAD_API_KEY,
userId: userId
});
return await sead.backup({
seedPhrase: seedPhrase,
n: 3, // 3 shares
m: 2, // Need 2 to restore
password: getUserPassword(),
onPaymentRequired: async (amt, cur) => {
const tx = await paymentProvider.send(amt, cur);
return { transactionId: tx.id, proof: tx.proof };
}
});
}
async function safeRestore(shares, password) {
try {
const sead = new SeadSimpleWithAPI({
apiUrl: 'https://b2bapi.sead.world/api/v1',
apiKey: process.env.SEAD_API_KEY,
userId: 'restore-session'
});
const result = await sead.restore({
shareTexts: shares,
password: password
});
if (!result.success) {
if (result.error.includes('password')) {
throw new Error('Wrong password');
}
throw new Error('Invalid shares');
}
return result.seedPhrase;
} catch (error) {
console.error('Restore failed:', error);
throw error;
}
}
function BackupButton({ seedPhrase, userId }) {
const [loading, setLoading] = useState(false);
const [shares, setShares] = useState([]);
const handleBackup = async () => {
setLoading(true);
const sead = new SeadSimpleWithAPI({
apiUrl: 'https://b2bapi.sead.world/api/v1',
apiKey: 'your-api-key',
userId: userId
});
const result = await sead.backup({ seedPhrase });
if (result.success) {
setShares(result.shares);
}
setLoading(false);
};
return (
<>
<button onClick={handleBackup} disabled={loading}>
{loading ? 'Creating backup...' : 'Backup Wallet'}
</button>
{shares.map((share, i) => (
<img key={i} src={share.qrCode} alt={`Share ${i + 1}`} />
))}
</>
);
}
// Vue 3 Composition API
const { ref } = Vue;
export default {
setup() {
const loading = ref(false);
const shares = ref([]);
const backup = async () => {
loading.value = true;
const sead = new SeadSimpleWithAPI({
apiUrl: 'https://b2bapi.sead.world/api/v1',
apiKey: 'your-api-key',
userId: store.userId
});
const result = await sead.backup({
seedPhrase: store.seedPhrase
});
if (result.success) {
shares.value = result.shares;
}
loading.value = false;
};
return { loading, shares, backup };
}
}
sead.backup({
seedPhrase: 'your seed phrase'
});
// Creates 3 shares, needs 2 to restore
sead.backup({
seedPhrase: 'your seed phrase',
n: 5, // Create 5 shares
m: 3 // Need 3 to restore
});
sead.backup({
seedPhrase: 'your seed phrase',
password: 'secret123'
});
Contact Sead support for a new one.
25,000 per wallet + 3 per user.
NO! All crypto happens locally.
Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
| Problem | Solution |
|---|---|
| "API key invalid" | Check format: hex.hex |
| "User ID required" | Always provide consistent userId |
| "Quota exhausted" | Implement payment handler |
| "Network error" | Check CORS and HTTPS |
| "Invalid shares" | Ensure shares from same backup |
You're done with the quickstart! 🎉