@graph8/sdk 0.5.3 → 0.7.1

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/dist/react.d.mts CHANGED
@@ -2,6 +2,314 @@ import * as _jitsu_js from '@jitsu/js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ReactNode } from 'react';
4
4
 
5
+ interface Snippet {
6
+ write_key: string;
7
+ tracking_host: string;
8
+ domains: string[];
9
+ /** Ready-to-use React component import for @graph8/nextjs. */
10
+ react_snippet: string;
11
+ /** Vanilla JS script tag for non-React apps. */
12
+ script_tag: string;
13
+ /** Full configuration object (gtm/config.json). */
14
+ config: Record<string, unknown>;
15
+ }
16
+ /**
17
+ * Snippet API — fetch your org's graph8 tracking snippet programmatically, to
18
+ * embed the tracker into an app or a customer's site (the write key, a React
19
+ * component, a vanilla `<script>` tag, allowed domains, and the full config).
20
+ * Requires an API key (server-side). Built on the hardened HTTP core, so it
21
+ * throws a typed `G8Error` on failure and retries transient errors.
22
+ *
23
+ * Backed by `GET /api/v1/snippet`.
24
+ */
25
+ declare const createSnippetClient: (apiKey: string, apiUrl?: string) => {
26
+ /** Get your org's tracking snippet (write key + React/script-tag embeds + config). */
27
+ get(): Promise<Snippet>;
28
+ };
29
+
30
+ interface MarketplaceProfile {
31
+ id: string;
32
+ email: string;
33
+ first_name?: string | null;
34
+ last_name?: string | null;
35
+ marketplace_role?: string | null;
36
+ country_code?: string | null;
37
+ monthly_rate_usd?: string | null;
38
+ per_meeting_rate_usd?: string | null;
39
+ availability_status?: string | null;
40
+ bio?: string | null;
41
+ is_complete: boolean;
42
+ }
43
+ interface MarketplaceOffer {
44
+ id: string;
45
+ org_id: string;
46
+ org_name?: string | null;
47
+ sdr_id: string;
48
+ status: string;
49
+ monthly_rate_usd?: string | null;
50
+ per_meeting_rate_usd?: string | null;
51
+ created_at?: string | null;
52
+ }
53
+ interface MarketplaceHiring {
54
+ id: string;
55
+ org_id: string;
56
+ sdr_id: string;
57
+ status: string;
58
+ sdr_name?: string | null;
59
+ sdr_role?: string | null;
60
+ sdr_email?: string | null;
61
+ monthly_rate_usd?: string | null;
62
+ per_meeting_rate_usd?: string | null;
63
+ started_at?: string | null;
64
+ }
65
+ /**
66
+ * Marketplace API — for SDR/AE talent on the graph8 marketplace. View your
67
+ * profile, see pending hire offers and respond to them, and list your active
68
+ * hirings. Requires a personal API key (server-side). Built on the hardened
69
+ * HTTP core, so every method throws a typed `G8Error` on failure and retries
70
+ * transient errors.
71
+ *
72
+ * Backed by `/api/v1/marketplace`.
73
+ */
74
+ declare const createMarketplaceClient: (apiKey: string, apiUrl?: string) => {
75
+ /** Your own marketplace SDR profile. */
76
+ profile(): Promise<MarketplaceProfile>;
77
+ /** Pending hire offers you can accept or reject. */
78
+ offers(): Promise<{
79
+ offers: MarketplaceOffer[];
80
+ count: number;
81
+ }>;
82
+ /** Accept a pending hire offer (by hiring id). */
83
+ acceptOffer(hiringId: string): Promise<Record<string, unknown>>;
84
+ /** Reject a pending hire offer (by hiring id). */
85
+ rejectOffer(hiringId: string): Promise<Record<string, unknown>>;
86
+ /** Your active hiring contracts. */
87
+ hirings(): Promise<{
88
+ hirings: MarketplaceHiring[];
89
+ count: number;
90
+ }>;
91
+ };
92
+
93
+ interface AgencyInfo {
94
+ agency_org_id: string;
95
+ agency_org_name: string | null;
96
+ is_agency: boolean;
97
+ client_count: number;
98
+ /** Request header to set when operating a client org (e.g. "X-Target-Org-Id"). */
99
+ target_header: string;
100
+ }
101
+ interface AgencyClient {
102
+ /** Pass this as the `X-Target-Org-Id` header to operate this client org. */
103
+ org_id: string;
104
+ }
105
+ /**
106
+ * Agency API — for agency-scoped API keys (minted with `is_agency: true`).
107
+ * Discover the agency credential and the client orgs it may operate. To act on a
108
+ * client org, set the `X-Target-Org-Id` header (see `target_header`) to that
109
+ * client's `org_id` on your subsequent requests. Requires an agency API key
110
+ * (server-side); a non-agency key gets a `403`.
111
+ *
112
+ * Built on the hardened HTTP core (typed `G8Error` + retries). Backed by
113
+ * `/api/v1/agency`.
114
+ */
115
+ declare const createAgencyClient: (apiKey: string, apiUrl?: string) => {
116
+ /** Describe the agency credential: agency org + authorized client count. */
117
+ me(): Promise<AgencyInfo>;
118
+ /** List the client orgs this agency key may target via `X-Target-Org-Id`. */
119
+ clients(): Promise<{
120
+ data: AgencyClient[];
121
+ }>;
122
+ };
123
+
124
+ /** Filter operators supported by open-data search. */
125
+ type SearchOperator = "any_of" | "contains" | "all_of" | "none_of" | "is_empty" | "is_not_empty" | "between" | "exists";
126
+ /** A single search filter condition (named to avoid colliding with enrich's `SearchFilter`). */
127
+ interface SearchCondition {
128
+ /** Field to filter on, e.g. "job_title", "country", "industry". */
129
+ field: string;
130
+ operator: SearchOperator;
131
+ /** Filter values (operator-dependent; e.g. `["VP", "Director"]` for any_of). */
132
+ value?: unknown[];
133
+ }
134
+ interface SearchParams {
135
+ /** Filter conditions, combined with AND. */
136
+ filters?: SearchCondition[];
137
+ /** Page number, 1-indexed (1-100). */
138
+ page?: number;
139
+ /** Results per page (1-100, default 25). */
140
+ limit?: number;
141
+ }
142
+ interface SearchSaveParams extends SearchParams {
143
+ /** Title for the new list the matched records are saved into. */
144
+ list_title: string;
145
+ /** Max records to save (1-10,000, default 1,000). */
146
+ max_results?: number;
147
+ }
148
+ interface SearchContactItem {
149
+ first_name?: string | null;
150
+ last_name?: string | null;
151
+ middle_name?: string | null;
152
+ work_email?: string | null;
153
+ personal_emails?: string | null;
154
+ direct_phone?: string | null;
155
+ mobile_phone?: string | null;
156
+ job_title?: string | null;
157
+ job_department?: string | null;
158
+ seniority_level?: string | null;
159
+ role?: string | null;
160
+ linkedin_url?: string | null;
161
+ linkedin_headline?: string | null;
162
+ city?: string | null;
163
+ state?: string | null;
164
+ country?: string | null;
165
+ company_name?: string | null;
166
+ company_domain?: string | null;
167
+ company_industry?: string | null;
168
+ company_employee_count?: string | null;
169
+ company_country?: string | null;
170
+ confidence_score?: number | null;
171
+ }
172
+ interface SearchCompanyItem {
173
+ name?: string | null;
174
+ domain?: string | null;
175
+ website?: string | null;
176
+ description?: string | null;
177
+ industry?: string | null;
178
+ industry_group?: string | null;
179
+ employee_count?: string | null;
180
+ revenue?: string | null;
181
+ founded_year?: number | null;
182
+ phone?: string | null;
183
+ address?: string | null;
184
+ city?: string | null;
185
+ state?: string | null;
186
+ country?: string | null;
187
+ zip?: number | null;
188
+ linkedin_url?: string | null;
189
+ linkedin_followers?: string | null;
190
+ facebook_url?: string | null;
191
+ twitter_url?: string | null;
192
+ crunchbase_url?: string | null;
193
+ logo_url?: string | null;
194
+ }
195
+ interface SearchSaveResult {
196
+ list_id: number;
197
+ list_title: string;
198
+ estimated_total: number;
199
+ status: string;
200
+ }
201
+ /**
202
+ * Search API — prospect the open-data graph for new contacts and companies by
203
+ * filter, and optionally save the matches straight into a list. Requires API
204
+ * key (server-side). Built on the hardened HTTP core, so every method throws a
205
+ * typed `G8Error` on failure and retries transient errors.
206
+ *
207
+ * Backed by `/api/v1/search`.
208
+ */
209
+ declare const createSearchClient: (apiKey: string, apiUrl?: string) => {
210
+ /** Search open-data contacts by filter. */
211
+ contacts(params?: SearchParams): Promise<{
212
+ data: SearchContactItem[];
213
+ }>;
214
+ /** Search open-data companies by filter. */
215
+ companies(params?: SearchParams): Promise<{
216
+ data: SearchCompanyItem[];
217
+ }>;
218
+ /** Search contacts and save the matches into a new list. */
219
+ saveContacts(params: SearchSaveParams): Promise<SearchSaveResult>;
220
+ /** Search companies and save the matches into a new list. */
221
+ saveCompanies(params: SearchSaveParams): Promise<SearchSaveResult>;
222
+ };
223
+
224
+ /** Ad platform an audience can sync to. */
225
+ type AudienceSyncPlatform = "meta" | "linkedin" | "google" | "x";
226
+ /** Sync mode: full mirror, or only ever add members. */
227
+ type AudienceSyncMode = "mirror" | "append_only";
228
+ interface AudienceSync {
229
+ id: number;
230
+ audience_id: number;
231
+ platform: string;
232
+ platform_audience_name: string | null;
233
+ mode: string;
234
+ refresh_cadence_hours: number;
235
+ is_active: boolean;
236
+ status: string | null;
237
+ last_sync_at: string | null;
238
+ created_at: string | null;
239
+ }
240
+ interface AudienceSyncCreateParams {
241
+ /** Audience list ID to sync. */
242
+ audience_id: number;
243
+ platform: AudienceSyncPlatform;
244
+ platform_audience_name?: string;
245
+ /** Default "mirror". */
246
+ mode?: AudienceSyncMode;
247
+ /** Refresh cadence in hours (0-720; default 24). */
248
+ refresh_cadence_hours?: number;
249
+ /** Platform-specific config (OAuth creds, ad-account ids, etc.). */
250
+ platform_config?: Record<string, unknown>;
251
+ /** Audience list IDs whose members should be suppressed from the sync. */
252
+ suppression_list_ids?: number[];
253
+ }
254
+ interface AudienceSyncUpdateParams {
255
+ mode?: AudienceSyncMode;
256
+ refresh_cadence_hours?: number;
257
+ is_active?: boolean;
258
+ suppression_list_ids?: number[];
259
+ }
260
+ interface AudienceSyncRun {
261
+ id: number;
262
+ started_at: string | null;
263
+ finished_at: string | null;
264
+ status: string | null;
265
+ members_added: number | null;
266
+ members_removed: number | null;
267
+ total_members: number | null;
268
+ error_message: string | null;
269
+ }
270
+ interface AudienceSyncError {
271
+ id: number;
272
+ started_at: string | null;
273
+ error_message: string | null;
274
+ details: Record<string, unknown> | null;
275
+ }
276
+ /**
277
+ * Audiences API — sync an audience list to ad platforms (Meta, LinkedIn,
278
+ * Google, X). Requires API key (server-side). Built on the hardened HTTP core,
279
+ * so every method throws a typed `G8Error` on failure and retries transient
280
+ * 429/5xx/network errors.
281
+ *
282
+ * Backed by `/api/v1/audience-syncs`.
283
+ */
284
+ declare const createAudiencesClient: (apiKey: string, apiUrl?: string) => {
285
+ /** List all audience syncs for the organization. */
286
+ list(): Promise<{
287
+ data: AudienceSync[];
288
+ }>;
289
+ /** Create a new audience sync to an ad platform. */
290
+ create(params: AudienceSyncCreateParams): Promise<AudienceSync>;
291
+ /** Get a single audience sync by ID. */
292
+ get(configId: number): Promise<AudienceSync>;
293
+ /** Update an audience sync (partial). */
294
+ update(configId: number, fields: AudienceSyncUpdateParams): Promise<AudienceSync>;
295
+ /** Delete an audience sync. */
296
+ delete(configId: number): Promise<{
297
+ data: Record<string, unknown>;
298
+ }>;
299
+ /** Trigger an immediate sync run for a config. */
300
+ trigger(configId: number): Promise<{
301
+ data: Record<string, unknown>;
302
+ }>;
303
+ /** List recent sync runs for a config (most recent first). */
304
+ runs(configId: number): Promise<{
305
+ data: AudienceSyncRun[];
306
+ }>;
307
+ /** List recent sync errors for a config. */
308
+ errors(configId: number): Promise<{
309
+ data: AudienceSyncError[];
310
+ }>;
311
+ };
312
+
5
313
  interface MeetingAttendee {
6
314
  name: string | null;
7
315
  email: string;
@@ -587,7 +895,8 @@ interface WorkflowListParams {
587
895
  }
588
896
  /**
589
897
  * Workflows API - automation workflows with nodes, connections, and execution lifecycle.
590
- * Requires API key (server-side).
898
+ * Requires API key (server-side). On the hardened HTTP core: throws a typed
899
+ * `G8Error` on failure and retries transient errors.
591
900
  *
592
901
  * The graph8 workflow surface treats the whole workflow definition as a single
593
902
  * record updated via `update()` — there are no per-node CRUD endpoints. To edit
@@ -652,9 +961,9 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
652
961
  }>;
653
962
  /** Execute a workflow immediately with a trigger payload. */
654
963
  execute(workflowId: string, triggerPayload?: Record<string, unknown>): Promise<WorkflowExecution>;
655
- /** Get the status + output of a workflow execution. */
964
+ /** Get the status + outputs of a single execution. */
656
965
  getExecution(executionId: string): Promise<WorkflowExecution>;
657
- /** Pause an in-flight execution. */
966
+ /** Pause a running execution. */
658
967
  pauseExecution(executionId: string): Promise<{
659
968
  data: {
660
969
  paused: boolean;
@@ -666,34 +975,32 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
666
975
  resumed: boolean;
667
976
  };
668
977
  }>;
669
- /** Stop an execution (terminal state — cannot resume). */
978
+ /** Stop an execution. */
670
979
  stopExecution(executionId: string): Promise<{
671
980
  data: {
672
981
  stopped: boolean;
673
982
  };
674
983
  }>;
675
- /** Get the status of a workflow's external trigger (e.g. "waiting for webhook"). */
984
+ /** Get the trigger status (e.g. schedule / webhook wiring) for a workflow. */
676
985
  getTriggerStatus(workflowId: string): Promise<{
677
986
  data: {
678
987
  status: string;
679
988
  details: Record<string, unknown>;
680
989
  };
681
990
  }>;
682
- /** Reset the trigger cursor (e.g. for event-stream triggers — resume from beginning). */
991
+ /** Reset a workflow's trigger cursor / state. */
683
992
  resetTrigger(workflowId: string): Promise<{
684
993
  data: {
685
994
  reset: boolean;
686
995
  };
687
996
  }>;
688
- /**
689
- * List available node types with schemas. Pass a `type` param to fetch one type's full schema.
690
- */
997
+ /** Catalog of available workflow node types with config + output schemas. */
691
998
  nodeTypes(params?: {
692
999
  type?: string;
693
1000
  }): Promise<{
694
1001
  data: NodeTypeSchema[];
695
1002
  }>;
696
- /** Slack workspace users (for Slack action recipients). */
1003
+ /** Slack users available to workflow nodes. */
697
1004
  listSlackUsers(): Promise<{
698
1005
  data: Array<{
699
1006
  id: string;
@@ -701,7 +1008,7 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
701
1008
  email: string | null;
702
1009
  }>;
703
1010
  }>;
704
- /** Slack channels. */
1011
+ /** Slack channels available to workflow nodes. */
705
1012
  listSlackChannels(): Promise<{
706
1013
  data: Array<{
707
1014
  id: string;
@@ -709,7 +1016,7 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
709
1016
  is_private: boolean;
710
1017
  }>;
711
1018
  }>;
712
- /** Roam (Copilot chat) users. */
1019
+ /** Roam users available to workflow nodes. */
713
1020
  listRoamUsers(): Promise<{
714
1021
  data: Array<{
715
1022
  id: string;
@@ -717,14 +1024,14 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
717
1024
  email: string | null;
718
1025
  }>;
719
1026
  }>;
720
- /** Roam (Copilot chat) groups. */
1027
+ /** Roam groups available to workflow nodes. */
721
1028
  listRoamGroups(): Promise<{
722
1029
  data: Array<{
723
1030
  id: string;
724
1031
  name: string;
725
1032
  }>;
726
1033
  }>;
727
- /** Available MCP servers (for Agent-node integrations). */
1034
+ /** MCP servers available to workflow nodes. */
728
1035
  listMcpServers(): Promise<{
729
1036
  data: Array<{
730
1037
  id: string;
@@ -732,14 +1039,14 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
732
1039
  url: string;
733
1040
  }>;
734
1041
  }>;
735
- /** Available call dispositions (voice workflow nodes). */
1042
+ /** Disposition options available to workflow nodes. */
736
1043
  listDispositions(): Promise<{
737
1044
  data: Array<{
738
1045
  id: string;
739
1046
  label: string;
740
1047
  }>;
741
1048
  }>;
742
- /** Form field schema for form-trigger nodes. */
1049
+ /** Form field definitions for a given form (used by form-trigger nodes). */
743
1050
  listFormFields(formId: string): Promise<{
744
1051
  data: Array<{
745
1052
  name: string;
@@ -822,7 +1129,8 @@ interface PipelineSuggestion {
822
1129
  }
823
1130
  /**
824
1131
  * Stage Checklist Pipelines API - workflow pipelines with evidence + scripts.
825
- * Requires API key (server-side).
1132
+ * Requires API key (server-side). On the hardened HTTP core: throws a typed
1133
+ * `G8Error` on failure and retries transient errors.
826
1134
  *
827
1135
  * Backed by:
828
1136
  * GET /api/v1/pipelines
@@ -965,7 +1273,9 @@ interface PaginationMeta$2 {
965
1273
  has_next: boolean;
966
1274
  }
967
1275
  /**
968
- * Quotes API - quote-to-cash lifecycle. Requires API key (server-side).
1276
+ * Quotes API - quote-to-cash lifecycle. Requires API key (server-side). On the
1277
+ * hardened HTTP core: throws a typed `G8Error` on failure and retries transient
1278
+ * errors.
969
1279
  *
970
1280
  * Backed by:
971
1281
  * GET /api/v1/quotes
@@ -1118,7 +1428,9 @@ interface InboxSendResult {
1118
1428
  }
1119
1429
  /**
1120
1430
  * Inbox API — read + reply to multi-channel inbox threads (email, SMS, LinkedIn/HeyReach).
1121
- * Requires API key (server-side).
1431
+ * Requires API key (server-side). On the hardened HTTP core: throws a typed
1432
+ * `G8Error` on failure (e.g. 402 when an AI draft exceeds your credit balance)
1433
+ * and retries transient errors.
1122
1434
  *
1123
1435
  * Backed by:
1124
1436
  * GET /api/v1/inbox
@@ -1325,7 +1637,8 @@ interface SetFieldValueParams {
1325
1637
  }
1326
1638
  /**
1327
1639
  * Fields API - manage custom fields (columns) on contacts and companies.
1328
- * Requires API key (server-side).
1640
+ * Requires API key (server-side). On the hardened HTTP core: throws a typed
1641
+ * `G8Error` on failure and retries transient errors.
1329
1642
  *
1330
1643
  * Backed by:
1331
1644
  * GET /api/v1/fields — list contact fields
@@ -1719,8 +2032,11 @@ declare const createContactsClient: (apiKey: string, apiUrl?: string) => {
1719
2032
  }>;
1720
2033
  /** Get a single contact by ID. */
1721
2034
  get(contactId: number): Promise<Contact>;
1722
- /** Create a new contact. */
1723
- create(contact: ContactCreateParams): Promise<Contact>;
2035
+ /**
2036
+ * Create a new contact. Pass `idempotencyKey` to make a retry safe — the
2037
+ * same key returns the first result instead of creating a duplicate (A6).
2038
+ */
2039
+ create(contact: ContactCreateParams, idempotencyKey?: string): Promise<Contact>;
1724
2040
  /** Update a contact (partial). */
1725
2041
  update(contactId: number, fields: ContactUpdateParams): Promise<{
1726
2042
  updated: number;
@@ -1737,18 +2053,44 @@ declare const createContactsClient: (apiKey: string, apiUrl?: string) => {
1737
2053
  createColumn(params: ContactColumnCreateParams): Promise<ContactColumn>;
1738
2054
  };
1739
2055
 
1740
- type WebhookEvent = "reply_received" | "meeting_booked" | "contact_enriched" | "contact_created" | "sequence_completed" | "sequence_replied" | "campaign_launched" | "form_submitted" | "visitor_identified";
1741
- type WebhookCallback = (data: Record<string, unknown>) => void;
1742
2056
  /**
1743
- * Webhooks - listen for graph8 events. Requires API key (server-side).
2057
+ * Known graph8 webhook event types.
1744
2058
  *
1745
- * For client-side real-time events, use g8.visitors.onIntent() or g8.chat.on() instead.
2059
+ * Source of truth is the backend ``WEBHOOK_EVENTS`` catalog
2060
+ * (campaign_builder/services/webhook_service.py). Keep in sync when the backend
2061
+ * adds events. ``WebhookEvent`` also accepts any string so a newly-added
2062
+ * backend event never breaks a client that hasn't upgraded.
1746
2063
  */
1747
- declare const createWebhooksClient: (apiKey: string, apiUrl?: string) => {
1748
- /** Register a listener for a webhook event. Starts polling automatically. */
1749
- on(event: WebhookEvent, callback: WebhookCallback): void;
1750
- /** Stop all webhook polling. */
1751
- stop(): void;
2064
+ declare const KNOWN_WEBHOOK_EVENTS: readonly ["campaign.created", "campaign.updated", "campaign.deleted", "campaign.launched", "campaign.paused", "campaign.completed", "campaign.status_changed", "campaign.content_ready", "document.generated", "document.failed", "intelligence.completed", "intelligence.failed", "company.enriched", "company_intelligence.completed", "audience.ready", "audience.failed", "sequence.deployed", "sequence.started", "sequence.paused", "sequence.completed", "engagement.email_sent", "engagement.email_replied", "engagement.email_bounced", "engagement.email_skipped", "engagement.call_dispatched", "engagement.sms_sent", "engagement.sms_replied", "engagement.whatsapp_sent", "engagement.linkedin_connection_sent", "engagement.linkedin_message_sent", "engagement.linkedin_inmail_sent", "engagement.linkedin_reply_received", "engagement.linkedin_connection_accepted", "meeting.booked", "meeting.cancelled", "meeting.rescheduled"];
2065
+ type WebhookEvent = (typeof KNOWN_WEBHOOK_EVENTS)[number] | (string & {});
2066
+ /** The decoded body graph8 delivers to a webhook endpoint. */
2067
+ interface WebhookEventPayload {
2068
+ event: WebhookEvent;
2069
+ timestamp: string;
2070
+ data: Record<string, unknown>;
2071
+ org_id: string;
2072
+ /** Stable per-delivery id (present once the backend adds it; for consumer dedup). */
2073
+ id?: string;
2074
+ }
2075
+ interface ConstructEventOptions {
2076
+ /**
2077
+ * Reject events whose ``X-Studio-Timestamp`` is older (or newer) than this
2078
+ * many seconds — replay protection. Disabled when 0/undefined.
2079
+ */
2080
+ toleranceSeconds?: number;
2081
+ }
2082
+ /**
2083
+ * Webhooks client (server-side). graph8 webhooks are PUSH — graph8 POSTs to your
2084
+ * endpoint; you verify each delivery with {@link constructEvent}. (The previous
2085
+ * polling implementation hit a feed endpoint that never existed and is removed.)
2086
+ */
2087
+ declare const createWebhooksClient: (_apiKey: string, apiUrl?: string) => {
2088
+ /** Base URL the webhook subscription API lives under. */
2089
+ baseUrl: string;
2090
+ /** Known event types (for autocomplete / validation). */
2091
+ knownEvents: readonly ["campaign.created", "campaign.updated", "campaign.deleted", "campaign.launched", "campaign.paused", "campaign.completed", "campaign.status_changed", "campaign.content_ready", "document.generated", "document.failed", "intelligence.completed", "intelligence.failed", "company.enriched", "company_intelligence.completed", "audience.ready", "audience.failed", "sequence.deployed", "sequence.started", "sequence.paused", "sequence.completed", "engagement.email_sent", "engagement.email_replied", "engagement.email_bounced", "engagement.email_skipped", "engagement.call_dispatched", "engagement.sms_sent", "engagement.sms_replied", "engagement.whatsapp_sent", "engagement.linkedin_connection_sent", "engagement.linkedin_message_sent", "engagement.linkedin_inmail_sent", "engagement.linkedin_reply_received", "engagement.linkedin_connection_accepted", "meeting.booked", "meeting.cancelled", "meeting.rescheduled"];
2092
+ /** Verify an incoming webhook's HMAC signature and return the parsed event. */
2093
+ constructEvent(payload: string, signature: string, timestamp: string | number, secret: string, opts?: ConstructEventOptions): WebhookEventPayload;
1752
2094
  };
1753
2095
 
1754
2096
  interface LandingPage {
@@ -1759,7 +2101,9 @@ interface LandingPage {
1759
2101
  published_url: string | null;
1760
2102
  }
1761
2103
  /**
1762
- * Landing pages - clone, create, publish. Requires API key (server-side).
2104
+ * Landing pages - clone, create, publish. Requires API key (server-side). On the
2105
+ * hardened HTTP core: throws a typed `G8Error` on failure and retries transient
2106
+ * errors.
1763
2107
  */
1764
2108
  declare const createPagesClient: (apiKey: string, apiUrl?: string) => {
1765
2109
  /** Clone a landing page from any URL. */
@@ -2117,6 +2461,12 @@ interface AnalyticsOverview {
2117
2461
  }
2118
2462
  /**
2119
2463
  * Analytics - dashboard data and metrics. Requires API key (server-side).
2464
+ *
2465
+ * On the hardened HTTP core: throws a typed `G8Error` on failure and retries
2466
+ * transient errors. Note the deliberate behavior change vs the preview client —
2467
+ * a non-2xx response now **throws** instead of silently returning an all-zeros
2468
+ * overview, so callers can distinguish genuinely-zero activity from an auth/5xx
2469
+ * failure.
2120
2470
  */
2121
2471
  declare const createAnalyticsClient: (apiKey: string, apiUrl?: string) => {
2122
2472
  overview(config?: {
@@ -2149,7 +2499,9 @@ interface Integration {
2149
2499
  connected_at: string | null;
2150
2500
  }
2151
2501
  /**
2152
- * Integrations - connect CRM platforms, trigger syncs. Requires API key (server-side).
2502
+ * Integrations - connect CRM platforms, trigger syncs. Requires API key
2503
+ * (server-side). On the hardened HTTP core: throws a typed `G8Error` on failure
2504
+ * and retries transient errors.
2153
2505
  */
2154
2506
  declare const createIntegrationsClient: (apiKey: string, apiUrl?: string) => {
2155
2507
  list(): Promise<Integration[]>;
@@ -2185,6 +2537,8 @@ interface CampaignStats {
2185
2537
  }
2186
2538
  /**
2187
2539
  * Campaigns - create, manage, launch campaigns. Requires API key (server-side).
2540
+ * On the hardened HTTP core: throws a typed `G8Error` on failure and retries
2541
+ * transient errors.
2188
2542
  */
2189
2543
  declare const createCampaignsClient: (apiKey: string, apiUrl?: string) => {
2190
2544
  list(page?: number, limit?: number): Promise<Campaign[]>;
@@ -2454,7 +2808,8 @@ interface SearchResults {
2454
2808
  /**
2455
2809
  * Enrichment API - person/company lookup, email verification, prospecting search.
2456
2810
  *
2457
- * Requires API key (server-side only). Credits charged per call.
2811
+ * Requires API key (server-side only). Credits charged per call. On the hardened
2812
+ * HTTP core: throws a typed `G8Error` on failure and retries transient errors.
2458
2813
  */
2459
2814
  declare const createEnrichClient: (apiKey: string, apiUrl?: string) => {
2460
2815
  /** Look up a person by email, LinkedIn, or name + company. Costs 1 credit. */
@@ -2761,6 +3116,11 @@ declare const useG8: () => {
2761
3116
  _intent: ReturnType<typeof createIntentClient> | null;
2762
3117
  _studio: ReturnType<typeof createStudioClient> | null;
2763
3118
  _meetings: ReturnType<typeof createMeetingsClient> | null;
3119
+ _audiences: ReturnType<typeof createAudiencesClient> | null;
3120
+ _search: ReturnType<typeof createSearchClient> | null;
3121
+ _agency: ReturnType<typeof createAgencyClient> | null;
3122
+ _marketplace: ReturnType<typeof createMarketplaceClient> | null;
3123
+ _snippet: ReturnType<typeof createSnippetClient> | null;
2764
3124
  init(config: G8Config): void;
2765
3125
  track(event: string, properties?: TrackProperties): void;
2766
3126
  identify(userId: string, properties?: IdentifyProperties): void;
@@ -2925,8 +3285,9 @@ declare const useG8: () => {
2925
3285
  }>;
2926
3286
  };
2927
3287
  get webhooks(): {
2928
- on(event: WebhookEvent, callback: (data: Record<string, unknown>) => void): void;
2929
- stop(): void;
3288
+ baseUrl: string;
3289
+ knownEvents: readonly ["campaign.created", "campaign.updated", "campaign.deleted", "campaign.launched", "campaign.paused", "campaign.completed", "campaign.status_changed", "campaign.content_ready", "document.generated", "document.failed", "intelligence.completed", "intelligence.failed", "company.enriched", "company_intelligence.completed", "audience.ready", "audience.failed", "sequence.deployed", "sequence.started", "sequence.paused", "sequence.completed", "engagement.email_sent", "engagement.email_replied", "engagement.email_bounced", "engagement.email_skipped", "engagement.call_dispatched", "engagement.sms_sent", "engagement.sms_replied", "engagement.whatsapp_sent", "engagement.linkedin_connection_sent", "engagement.linkedin_message_sent", "engagement.linkedin_inmail_sent", "engagement.linkedin_reply_received", "engagement.linkedin_connection_accepted", "meeting.booked", "meeting.cancelled", "meeting.rescheduled"];
3290
+ constructEvent(payload: string, signature: string, timestamp: string | number, secret: string, opts?: ConstructEventOptions): WebhookEventPayload;
2930
3291
  };
2931
3292
  get contacts(): {
2932
3293
  list(params?: ContactListParams): Promise<{
@@ -2934,7 +3295,7 @@ declare const useG8: () => {
2934
3295
  total: number;
2935
3296
  }>;
2936
3297
  get(contactId: number): Promise<Contact>;
2937
- create(contact: ContactCreateParams): Promise<Contact>;
3298
+ create(contact: ContactCreateParams, idempotencyKey?: string): Promise<Contact>;
2938
3299
  update(contactId: number, fields: ContactUpdateParams): Promise<{
2939
3300
  updated: number;
2940
3301
  }>;
@@ -3415,6 +3776,58 @@ declare const useG8: () => {
3415
3776
  }>;
3416
3777
  get(meetingId: string): Promise<MeetingDetail>;
3417
3778
  };
3779
+ get audiences(): {
3780
+ list(): Promise<{
3781
+ data: AudienceSync[];
3782
+ }>;
3783
+ create(params: AudienceSyncCreateParams): Promise<AudienceSync>;
3784
+ get(configId: number): Promise<AudienceSync>;
3785
+ update(configId: number, fields: AudienceSyncUpdateParams): Promise<AudienceSync>;
3786
+ delete(configId: number): Promise<{
3787
+ data: Record<string, unknown>;
3788
+ }>;
3789
+ trigger(configId: number): Promise<{
3790
+ data: Record<string, unknown>;
3791
+ }>;
3792
+ runs(configId: number): Promise<{
3793
+ data: AudienceSyncRun[];
3794
+ }>;
3795
+ errors(configId: number): Promise<{
3796
+ data: AudienceSyncError[];
3797
+ }>;
3798
+ };
3799
+ get search(): {
3800
+ contacts(params?: SearchParams): Promise<{
3801
+ data: SearchContactItem[];
3802
+ }>;
3803
+ companies(params?: SearchParams): Promise<{
3804
+ data: SearchCompanyItem[];
3805
+ }>;
3806
+ saveContacts(params: SearchSaveParams): Promise<SearchSaveResult>;
3807
+ saveCompanies(params: SearchSaveParams): Promise<SearchSaveResult>;
3808
+ };
3809
+ get agency(): {
3810
+ me(): Promise<AgencyInfo>;
3811
+ clients(): Promise<{
3812
+ data: AgencyClient[];
3813
+ }>;
3814
+ };
3815
+ get marketplace(): {
3816
+ profile(): Promise<MarketplaceProfile>;
3817
+ offers(): Promise<{
3818
+ offers: MarketplaceOffer[];
3819
+ count: number;
3820
+ }>;
3821
+ acceptOffer(hiringId: string): Promise<Record<string, unknown>>;
3822
+ rejectOffer(hiringId: string): Promise<Record<string, unknown>>;
3823
+ hirings(): Promise<{
3824
+ hirings: MarketplaceHiring[];
3825
+ count: number;
3826
+ }>;
3827
+ };
3828
+ get snippet(): {
3829
+ get(): Promise<Snippet>;
3830
+ };
3418
3831
  get initialized(): boolean;
3419
3832
  _assertInit(): void;
3420
3833
  _assertKey(module: string): void;