DobLink
DobLink is DobProtocol's integration layer. It provides two tools for bringing pools to external websites and applications:
- Embeddable Widgets -- Customizable pool cards that can be embedded on any website
- JavaScript SDK -- A TypeScript/JavaScript library (
@dobprotocol/sdk) for full programmatic access to DobProtocol
What You Can Do
| Capability | Widget | SDK |
|---|---|---|
| Display pool info on external sites | Yes | Yes |
| Create pools from your own app | -- | Yes |
| Track analytics (views, referrers) | Yes | Yes |
| Manage pool participants | -- | Yes |
| Query pool metrics (APR, distributions) | -- | Yes |
| Browse marketplace listings | -- | Yes |
| Execute pool actions (deposit, distribute) | -- | Yes |
| Create projects | -- | Yes |
Embeddable Widgets
Pool owners can create customizable widgets to embed on external websites. Each widget:
- Links to a specific pool
- Has a configurable theme (light/dark), colors, and button text
- Tracks views and referrer domains automatically
- Can be restricted to specific domains
Widget Configuration
| Option | Description | Default |
|---|---|---|
theme | Color theme | light |
primary_color | Accent color (hex) | #597CE9 |
button_text | Call-to-action text | Invest Now |
show_apr | Show estimated APR | true |
show_members | Show participant count | true |
show_distributions | Show distribution info | true |
show_network | Show blockchain network | true |
allowed_domains | Domain whitelist | All domains |
Creating a Widget
Widgets can be created through:
- The DobProtocol app at home.dobprotocol.com
- The SDK programmatically (see SDK Reference)
JavaScript SDK
The @dobprotocol/sdk package allows external developers to integrate DobProtocol pools directly into their applications. It handles authentication, pool creation, metrics queries, and more.
npm install @dobprotocol/sdk
import { DobProtocolClient } from '@dobprotocol/sdk';
const dob = new DobProtocolClient({
apiKey: 'dob_sdk_...',
network: 'mainnet',
});
// Query any pool's metrics
const pool = await dob.pools.getPool('CDXYZ...');
console.log(`APR: ${pool.estimated_apr}%`);
See the full SDK documentation:
- Getting Started -- Installation, API keys, first request
- SDK Reference -- Complete API reference
- Examples -- Code examples for common use cases
Architecture
External Website / App
|
├── DobLink Widget (iframe/embed)
| └── Displays pool info + tracks views
|
└── @dobprotocol/sdk (npm package)
|
├── Authentication (wallet nonce/sign)
├── Pool creation (5-step Stellar deploy)
├── Pool queries (metrics, events, schedule)
├── Pool actions (deposit, distribute, transfer)
├── Marketplace (listings, stats, history)
├── Projects (group pools)
└── Widgets (create, manage, analytics)
|
▼
DobProtocol Backend API
(home.dobprotocol.com/api/sdk/*)
How SDK Authentication Works
External applications authenticate via SDK API keys:
- Pool owner creates an SDK key at home.dobprotocol.com
- Key includes domain whitelist and permission scopes (
read,write) - External app sends
X-DOB-API-Keyheader with each request - Backend validates key, checks domain, enforces rate limits (120 RPM)
For user-level operations (creating pools, signing transactions), the SDK also supports wallet-based JWT authentication.
Supported Networks
DobLink and the SDK currently support Stellar blockchain only:
| Network | ID | Use |
|---|---|---|
| Stellar Testnet | 9 | Development and testing |
| Stellar Mainnet | 10 | Production |
Integration with DobProtocol
| Integration | Purpose |
|---|---|
| Token Studio | Pool and share data for investment targets |
| DobValidator | TRUFA scores and certificate verification |
| Marketplace | Secondary market for pool shares |
| Smart Contracts | Stellar Splitter V2 for pool distribution |