Publishing
SDK Reference
This JavaScript/TypeScript SDK allows publishers to serve personalized ads to users based on their Ethereum or EVM-compatible wallet addresses.
Installation
Quick Start
Configuration
Constructor
Creates a new Specify client instance.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Configuration object |
|
| Your publisher API key (must start with |
Example
SDK Reference
serve()
Serves targeted advertising content to specified wallet address(es).
Parameters
Parameter | Type | Description |
---|---|---|
|
| Single wallet address or array of wallet addresses |
|
| Desired image format for the ad content |
Returns
Promise<SpecifyAd | null>
- Ad content object ornull
if no ad is found
Examples
Single wallet address:
Multiple wallet addresses - used when you have multiple addresses for one user:
Image Format Options
The Specify SDK supports three different ad image formats to match your layout needs:
Format | Aspect Ratio | Resolution | Description | Use Case |
---|---|---|---|---|
| 16:9 | 630x390 | Wide horizontal format | Hero banners, featured placements |
| 8:1 | 728x90 | Extended horizontal banner | Header/footer placements, leaderboards |
| 16:5 | 320x100 | Compact horizontal banner | Inline content, sidebars, mobile banners |
Return Type
When the serve()
method successfully finds an ad, it returns a SpecifyAd
object with the following properties:
Property | Type | Description |
---|---|---|
walletAddress | string | The wallet address that matched for this ad |
campaignId | string | Unique identifier for the ad campaign |
adId | string | Unique identifier for this specific ad |
headline | string (no markdown) | Ad headline text |
content | string (markdown) | Ad content with Markdown formatting (see Content Formatting section) |
ctaUrl | string | Call-to-action URL |
ctaLabel | string (no markdown) | Call-to-action button text |
imageUrl | string | URL to the ad image |
communityName | string (no markdown) | Name of the advertising community |
communityLogo | string | URL to the community logo |
imageFormat | string | The requested image format ( |
Content Formatting
The content
field in ad responses uses simplified Markdown formatting:
Format | Syntax | Example |
---|---|---|
Bold text |
|
|
|
|
|
Line breaks |
|
|
Underlined Text |
|
|
Italic Text |
|
|
Validation Rules
Publisher Key
Must start with
spk_
Must be exactly 34 characters long
Example:
spk_1234567890abcdef1234567890abcdef
Wallet Addresses
Must be valid Ethereum/EVM-compatible addresses
Must start with
0x
followed by 40 hexadecimal charactersCase-insensitive
Example:
0x742d35Cc6634C0532925a3b8D57C11E4a3e1A510
Address Limits
Minimum: 1 wallet address required
Maximum: 50 wallet addresses per request
Duplicate addresses are automatically removed
Best Practices
Error Handling
Always wrap SDK calls in try-catch blocks and handle specific error types:
Examples
React Integration
Node.js Server Integration
Schedule a call with us
Any other questions? Email us