@graph8/sdk 0.7.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -44
- package/dist/index.d.mts +224 -179
- package/dist/index.d.ts +224 -179
- package/dist/index.js +149 -193
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +149 -193
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +219 -171
- package/dist/react.d.ts +219 -171
- package/dist/react.js +149 -193
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +149 -193
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ const { data: listContacts } = await g8.lists.contacts(list.id);
|
|
|
70
70
|
// Enrich a person
|
|
71
71
|
const person = await g8.enrich.person({ email: 'jane@acme.com' });
|
|
72
72
|
|
|
73
|
-
// Search
|
|
73
|
+
// Search 700M+ contacts
|
|
74
74
|
const leads = await g8.enrich.search([
|
|
75
75
|
{ field: 'seniority_level', operator: 'any_of', value: ['VP', 'Director'] },
|
|
76
76
|
{ field: 'company_industry', operator: 'contains', value: ['SaaS'] },
|
|
@@ -88,14 +88,6 @@ await g8.campaigns.launch(campaign.id);
|
|
|
88
88
|
const signals = await g8.signals.company('acme.com');
|
|
89
89
|
// { score: 87, intent: 'high', signals: ['pricing_page_3x', 'case_study'] }
|
|
90
90
|
|
|
91
|
-
// Voice AI
|
|
92
|
-
const call = await g8.voice.start({ agent: 'sales-discovery', contactId: 123 });
|
|
93
|
-
const analysis = await g8.voice.analysis(call.id);
|
|
94
|
-
|
|
95
|
-
// Landing pages
|
|
96
|
-
const page = await g8.pages.clone('https://competitor.com/pricing');
|
|
97
|
-
const { url } = await g8.pages.publish(page.id);
|
|
98
|
-
|
|
99
91
|
// Webhook events (push model — verify each delivery server-side)
|
|
100
92
|
app.post('/webhooks/graph8', (req, res) => {
|
|
101
93
|
const event = g8.webhooks.constructEvent(
|
|
@@ -116,10 +108,25 @@ app.post('/webhooks/graph8', (req, res) => {
|
|
|
116
108
|
import { G8Provider, useG8 } from '@graph8/sdk/react';
|
|
117
109
|
|
|
118
110
|
// Layout
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
export const Layout = ({ children }: { children: React.ReactNode }) => (
|
|
112
|
+
<G8Provider writeKey="YOUR_WRITE_KEY">{children}</G8Provider>
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Any component. `useG8()` exposes the tracking calls, the progressive-form
|
|
116
|
+
// helpers, and the raw client — reach the rest of the surface through `g8`.
|
|
117
|
+
export const CTA = () => {
|
|
118
|
+
const { track, identify, page, reset, forms, g8 } = useG8();
|
|
119
|
+
return (
|
|
120
|
+
<button
|
|
121
|
+
onClick={() => {
|
|
122
|
+
track('cta_click', { placement: 'hero' });
|
|
123
|
+
g8.copilot.open({ greeting: 'How can I help?' });
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
Talk to us
|
|
127
|
+
</button>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
123
130
|
```
|
|
124
131
|
|
|
125
132
|
## Full API Reference
|
|
@@ -213,7 +220,7 @@ const { track, identify, visitors, copilot, calendar } = useG8();
|
|
|
213
220
|
| `g8.enrich.person(params)` | Look up a person (1 credit) |
|
|
214
221
|
| `g8.enrich.company(params)` | Look up a company (1 credit) |
|
|
215
222
|
| `g8.enrich.verifyEmail(email)` | Verify email (1 credit) |
|
|
216
|
-
| `g8.enrich.search(filters)` | Search
|
|
223
|
+
| `g8.enrich.search(filters)` | Search 700M+ contacts |
|
|
217
224
|
|
|
218
225
|
### Sequences (API key)
|
|
219
226
|
|
|
@@ -229,7 +236,6 @@ const { track, identify, visitors, copilot, calendar } = useG8();
|
|
|
229
236
|
| `g8.campaigns.list()` | List campaigns |
|
|
230
237
|
| `g8.campaigns.create(config)` | Create campaign |
|
|
231
238
|
| `g8.campaigns.launch(id)` | Launch campaign |
|
|
232
|
-
| `g8.campaigns.stats(id)` | Get campaign stats |
|
|
233
239
|
|
|
234
240
|
### Signals (write key or API key)
|
|
235
241
|
|
|
@@ -238,35 +244,6 @@ const { track, identify, visitors, copilot, calendar } = useG8();
|
|
|
238
244
|
| `g8.signals.company(domain)` | Get intent signals |
|
|
239
245
|
| `g8.signals.stream(domains, cb)` | Stream signals (polls 30s) |
|
|
240
246
|
|
|
241
|
-
### Analytics (API key)
|
|
242
|
-
|
|
243
|
-
| Method | Description |
|
|
244
|
-
|--------|-------------|
|
|
245
|
-
| `g8.analytics.overview(config?)` | Dashboard metrics |
|
|
246
|
-
|
|
247
|
-
### Integrations (API key)
|
|
248
|
-
|
|
249
|
-
| Method | Description |
|
|
250
|
-
|--------|-------------|
|
|
251
|
-
| `g8.integrations.list()` | List connected CRMs |
|
|
252
|
-
| `g8.integrations.connect(provider)` | Connect CRM |
|
|
253
|
-
| `g8.integrations.sync(provider)` | Trigger sync |
|
|
254
|
-
|
|
255
|
-
### Voice AI (API key)
|
|
256
|
-
|
|
257
|
-
| Method | Description |
|
|
258
|
-
|--------|-------------|
|
|
259
|
-
| `g8.voice.start(config)` | Start AI voice call |
|
|
260
|
-
| `g8.voice.analysis(sessionId)` | Get call analysis |
|
|
261
|
-
|
|
262
|
-
### Landing Pages (API key)
|
|
263
|
-
|
|
264
|
-
| Method | Description |
|
|
265
|
-
|--------|-------------|
|
|
266
|
-
| `g8.pages.clone(url)` | Clone from URL |
|
|
267
|
-
| `g8.pages.create(config)` | Create from template |
|
|
268
|
-
| `g8.pages.publish(id)` | Publish to CDN |
|
|
269
|
-
|
|
270
247
|
### Webhooks (API key)
|
|
271
248
|
|
|
272
249
|
| Method | Description |
|