11# Scope3 SDK
22
3- TypeScript client for the Scope3 Agentic Platform. Supports two personas (buyer, partner) with REST and MCP adapters.
3+ TypeScript client for the Scope3 Agentic Platform. Two entry points for two audiences:
4+
5+ - ** REST consumers** (humans, CLI, programmatic) → ` Scope3Client ` with typed resource methods
6+ - ** MCP consumers** (AI agents) → ` Scope3McpClient ` — thin connection helper with direct ` callTool ` /` readResource `
47
58## Installation
69
@@ -24,11 +27,11 @@ Obtain your API key from the Scope3 dashboard:
2427
2528## Quick Start
2629
27- The SDK uses a unified ` Scope3Client ` with a ` persona ` parameter to determine available resources.
30+ ### REST Client (Humans / CLI / Programmatic)
2831
29- ### Buyer Persona
32+ The ` Scope3Client ` provides typed resource methods and requires a ` persona ` parameter.
3033
31- For programmatic advertising -- manage advertisers, bundles, campaigns, and signals.
34+ #### Buyer Persona
3235
3336``` typescript
3437import { Scope3Client } from ' scope3' ;
@@ -66,41 +69,89 @@ const campaign = await client.campaigns.createDiscovery({
6669await client .campaigns .execute (campaign .data .id );
6770```
6871
69- ### Partner Persona
70-
71- For partner and agent management.
72+ #### Storefront Persona
7273
7374``` typescript
74- const partnerClient = new Scope3Client ({
75+ const sfClient = new Scope3Client ({
7576 apiKey: process .env .SCOPE3_API_KEY ! ,
76- persona: ' partner ' ,
77+ persona: ' storefront ' ,
7778});
7879
79- // List partners
80- const partners = await partnerClient . partners . list ();
80+ // Get your storefront
81+ const sf = await sfClient . storefront . get ();
8182
82- // Register an agent
83- const agent = await partnerClient .agents .register ({
84- name: ' My Agent' ,
83+ // Create an inventory source (registers an agent)
84+ const source = await sfClient .inventorySources .create ({
85+ sourceId: ' my-sales-agent' ,
86+ name: ' My Sales Agent' ,
87+ executionType: ' agent' ,
8588 type: ' SALES' ,
86- partnerId: ' partner-123' ,
89+ endpointUrl: ' https://my-agent.example.com/mcp' ,
90+ protocol: ' MCP' ,
91+ authenticationType: ' API_KEY' ,
92+ auth: { type: ' bearer' , token: ' my-api-key' },
8793});
94+
95+ // Check readiness
96+ const readiness = await sfClient .readiness .check ();
97+ ```
98+
99+ ### MCP Client (AI Agents)
100+
101+ The ` Scope3McpClient ` is a thin connection helper for AI agents. It wires up auth and the MCP URL, then exposes ` callTool() ` , ` readResource() ` , and ` listTools() ` as direct passthroughs. The MCP server handles routing and validation — no typed resource wrappers needed.
102+
103+ ``` typescript
104+ import { Scope3McpClient } from ' scope3' ;
105+
106+ const mcp = new Scope3McpClient ({
107+ apiKey: process .env .SCOPE3_API_KEY ! ,
108+ });
109+ await mcp .connect ();
110+
111+ // Call tools directly — the v2 buyer surface exposes:
112+ // api_call, ask_about_capability, help, health
113+ const result = await mcp .callTool (' api_call' , {
114+ method: ' GET' ,
115+ path: ' /api/v2/buyer/advertisers' ,
116+ });
117+
118+ // Ask what the API can do
119+ const capabilities = await mcp .callTool (' ask_about_capability' , {
120+ question: ' How do I create a campaign?' ,
121+ });
122+
123+ // List available tools
124+ const tools = await mcp .listTools ();
125+
126+ await mcp .disconnect ();
88127```
89128
90129## Configuration
91130
131+ ### Scope3Client (REST)
132+
92133``` typescript
93134const client = new Scope3Client ({
94135 apiKey: ' your-api-key' , // Required: Bearer token
95- persona: ' buyer' , // Required: 'buyer' | 'partner '
136+ persona: ' buyer' , // Required: 'buyer' | 'storefront '
96137 environment: ' production' , // Optional: 'production' (default) | 'staging'
97138 baseUrl: ' https://custom.com' , // Optional: overrides environment
98- adapter: ' rest' , // Optional: 'rest' (default) | 'mcp'
99139 timeout: 30000 , // Optional: request timeout in ms
100140 debug: false , // Optional: enable debug logging
101141});
102142```
103143
144+ ### Scope3McpClient (MCP)
145+
146+ ``` typescript
147+ const mcp = new Scope3McpClient ({
148+ apiKey: ' your-api-key' , // Required: Bearer token
149+ environment: ' production' , // Optional: 'production' (default) | 'staging'
150+ baseUrl: ' https://custom.com' , // Optional: overrides environment
151+ debug: false , // Optional: enable debug logging
152+ });
153+ ```
154+
104155## CLI
105156
106157``` bash
@@ -115,7 +166,7 @@ scope3 campaigns list --format json
115166scope3 bundles create --advertiser-id adv-123 --channels display,video
116167
117168# Override persona per-command
118- scope3 --persona partner partners list
169+ scope3 --persona storefront storefront get
119170
120171# See all commands
121172scope3 commands
@@ -125,17 +176,23 @@ scope3 commands
125176
126177### Buyer Resources
127178
128- - ` client.advertisers ` -- CRUD and sub-resources (conversionEvents, creativeSets, testCohorts)
129- - ` client.campaigns ` -- list, get, createDiscovery, updateDiscovery, createPerformance, updatePerformance, createAudience, execute, pause
179+ - ` client.advertisers ` -- CRUD and sub-resources (conversionEvents, creativeSets, testCohorts, eventSources, measurementData, catalogs, audiences, syndication, propertyLists )
180+ - ` client.campaigns ` -- list, get, createDiscovery, updateDiscovery, createPerformance, updatePerformance, createAudience, execute, pause, creatives(campaignId)
130181- ` client.bundles ` -- create, discoverProducts, browseProducts, products(bundleId)
131182- ` client.signals ` -- Discover signals
132183- ` client.reporting ` -- Get reporting metrics
133184- ` client.salesAgents ` -- List sales agents, register accounts
185+ - ` client.tasks ` -- Get task status
186+ - ` client.propertyListChecks ` -- Run and retrieve property list check reports
134187
135- ### Partner Resources
188+ ### Storefront Resources
136189
137- - ` client.partners ` -- list, create, update, archive
138- - ` client.agents ` -- list, get, register, update
190+ - ` client.storefront ` -- get, create, update, delete
191+ - ` client.inventorySources ` -- list, get, create, update, delete
192+ - ` client.agents ` -- list, get, update
193+ - ` client.readiness ` -- check
194+ - ` client.billing ` -- get, connect, status, transactions, payouts, onboardingUrl
195+ - ` client.notifications ` -- list, markAsRead, acknowledge, markAllAsRead
139196
140197## skill.md Support
141198
@@ -176,29 +233,29 @@ The SDK is manually maintained. When the Agentic API changes, update these files
1762331 . Check the latest skill.md for your persona:
177234 ``` bash
178235 curl https://api.agentic.scope3.com/api/v2/buyer/skill.md
179- curl https://api.agentic.scope3.com/api/v2/partner /skill.md
236+ curl https://api.agentic.scope3.com/api/v2/storefront /skill.md
180237 ```
1812382 . Compare against ` src/skill/bundled.ts ` and update if needed
1822393 . Update types in ` src/types/index.ts ` to match any schema changes
1832404 . Update resource methods in ` src/resources/ ` for endpoint changes
1842415 . Update CLI commands in ` src/cli/commands/ ` if applicable
1852426 . Run ` npm test ` and ` npm run build ` to verify
186- 7 . Run manual workflow tests: ` npm run test:buyer ` , ` npm run test:partner `
243+ 7 . Run manual workflow tests: ` npm run test:buyer ` , ` npm run test:storefront `
187244
188245### Integration Tests
189246
190247``` bash
191248export SCOPE3_API_KEY=your_key
192249npm run test:buyer # Buyer workflow
193- npm run test:partner # Partner workflow
250+ npm run test:storefront # Storefront workflow
194251npm run test:all # All workflows
195252```
196253
197254## Documentation
198255
199256- [ Getting Started] ( docs/getting-started.md )
200257- [ Buyer Guide] ( docs/buyer-guide.md )
201- - [ Partner Guide] ( docs/partner -guide.md )
258+ - [ Storefront Guide] ( docs/storefront -guide.md )
202259- [ CLI Reference] ( docs/cli-reference.md )
203260
204261## Contributing
0 commit comments