Documentation
¶
Index ¶
- Constants
- type AcceptInviteRequest
- type AcceptInviteResponse
- type AddContactTagsRequest
- type AuthResource
- func (r *AuthResource) ChangePassword(ctx context.Context, request *SDKChangePasswordRequest) (*Response, error)
- func (r *AuthResource) ForgotPassword(ctx context.Context, request *SDKForgotPasswordRequest) (*Response, error)
- func (r *AuthResource) Login(ctx context.Context, request *SDKLoginRequest) (*SDKAuthResponse, error)
- func (r *AuthResource) RefreshToken(ctx context.Context, request *SDKRefreshTokenRequest) (*SDKAuthResponse, error)
- func (r *AuthResource) Register(ctx context.Context, request *SDKRegisterRequest) (*SDKAuthResponse, error)
- func (r *AuthResource) ResetPassword(ctx context.Context, request *SDKResetPasswordRequest) (*Response, error)
- func (r *AuthResource) VerifyEmail(ctx context.Context, request *SDKVerifyEmailRequest) (*Response, error)
- type BillingPriceInfo
- type BillingProductInfo
- type BillingResource
- func (r *BillingResource) CancelSubscription(ctx context.Context, id string) (*Response, error)
- func (r *BillingResource) CreateCheckoutSession(ctx context.Context, request *CheckoutRequest) (*CheckoutResponse, error)
- func (r *BillingResource) CreateCustomer(ctx context.Context, request *CustomerRequest) (*CustomerResponse, error)
- func (r *BillingResource) CreateSubscription(ctx context.Context, request *SubscriptionRequest) (*SubscriptionResponse, error)
- func (r *BillingResource) GetCustomerPortal(ctx context.Context, request *PortalRequest) (*PortalResponse, error)
- func (r *BillingResource) RecordUsage(ctx context.Context, request *UsageRequest) (*Response, error)
- type ChatMessage
- type ChatRequest
- type ChatResponse
- type ChatSession
- type CheckoutItem
- type CheckoutRequest
- type CheckoutResponse
- type Client
- func (c *Client) ConfirmEmail(ctx context.Context, token string) (*ConfirmEmailResponse, error)
- func (c *Client) ForwardSESWebhook(ctx context.Context, payload []byte) error
- func (c *Client) ForwardStripeWebhook(ctx context.Context, payload []byte, signature string) error
- func (c *Client) HandleChatWebSocket(llm *LLMClient, opts ...WSOption) http.HandlerFunc
- func (c *Client) HandleClickTracking(cfg *HandlerConfig) http.HandlerFunc
- func (c *Client) HandleConfirmEmail(cfg *HandlerConfig) http.HandlerFunc
- func (c *Client) HandleOpenTracking(cfg *HandlerConfig) http.HandlerFunc
- func (c *Client) HandleSESWebhook(cfg *HandlerConfig) http.HandlerFunc
- func (c *Client) HandleStripeWebhook(cfg *HandlerConfig) http.HandlerFunc
- func (c *Client) HandleUnsubscribe(cfg *HandlerConfig) http.HandlerFunc
- func (c *Client) RecordClick(ctx context.Context, token, url string) error
- func (c *Client) RecordOpen(ctx context.Context, token string) error
- func (c *Client) RecordUnsubscribe(ctx context.Context, token string) error
- func (c *Client) RegisterHandlers(mux *http.ServeMux, prefix string, opts ...HandlerOption)
- type ClientOption
- type ConfirmEmailResponse
- type ContactActivityInfo
- type ContactRequest
- type ContactResponse
- type ContactStatsPoint
- type ContactsResource
- func (r *ContactsResource) AddContactTags(ctx context.Context, id string, request *AddContactTagsRequest) (*Response, error)
- func (r *ContactsResource) CreateContact(ctx context.Context, request *ContactRequest) (*ContactResponse, error)
- func (r *ContactsResource) GetContact(ctx context.Context, id string) (*SDKContactInfo, error)
- func (r *ContactsResource) GlobalUnsubscribe(ctx context.Context, request *GlobalUnsubscribeRequest) (*Response, error)
- func (r *ContactsResource) ListContactActivity(ctx context.Context, id string, limit int) (*ListContactActivityResponse, error)
- func (r *ContactsResource) RemoveContactTags(ctx context.Context, id string, request *RemoveContactTagsRequest) (*Response, error)
- func (r *ContactsResource) UpdateContact(ctx context.Context, id string, request *UpdateContactRequest) (*SDKContactInfo, error)
- type ContentResource
- func (r *ContentResource) GetContentPage(ctx context.Context, slug string) (*SDKContentPageInfo, error)
- func (r *ContentResource) GetContentPost(ctx context.Context, slug string) (*SDKContentPostInfo, error)
- func (r *ContentResource) ListContentCategories(ctx context.Context) (*ListSDKContentCategoriesResponse, error)
- func (r *ContentResource) ListContentPages(ctx context.Context, page int, pageSize int) (*ListSDKContentPagesResponse, error)
- func (r *ContentResource) ListContentPosts(ctx context.Context, page int, pageSize int, categorySlug string) (*ListSDKContentPostsResponse, error)
- type CustomerRequest
- type CustomerResponse
- type CustomersResource
- func (r *CustomersResource) DeleteCustomer(ctx context.Context, id string) (*Response, error)
- func (r *CustomersResource) GetCustomerByEmail(ctx context.Context, email string) (*SDKCustomerInfo, error)
- func (r *CustomersResource) GetCustomerById(ctx context.Context, id string) (*SDKCustomerInfo, error)
- func (r *CustomersResource) ListCustomerInvoices(ctx context.Context, email string, limit int) (*ListCustomerInvoicesResponse, error)
- func (r *CustomersResource) ListCustomerInvoicesById(ctx context.Context, id string, limit int) (*ListCustomerInvoicesResponse, error)
- func (r *CustomersResource) ListCustomerOrders(ctx context.Context, email string, limit int) (*ListCustomerOrdersResponse, error)
- func (r *CustomersResource) ListCustomerOrdersById(ctx context.Context, id string, limit int) (*ListCustomerOrdersResponse, error)
- func (r *CustomersResource) ListCustomerPayments(ctx context.Context, email string, limit int) (*ListCustomerPaymentsResponse, error)
- func (r *CustomersResource) ListCustomerPaymentsById(ctx context.Context, id string, limit int) (*ListCustomerPaymentsResponse, error)
- func (r *CustomersResource) ListCustomerSubscriptions(ctx context.Context, email string) (*ListCustomerSubscriptionsResponse, error)
- func (r *CustomersResource) ListCustomerSubscriptionsById(ctx context.Context, id string) (*ListCustomerSubscriptionsResponse, error)
- func (r *CustomersResource) UpdateCustomer(ctx context.Context, id string, request *SDKUpdateCustomerRequest) (*SDKCustomerInfo, error)
- type EmailEventInfo
- type EmailStatsPoint
- type EmailStatusResponse
- type EmailsResource
- func (r *EmailsResource) GetEmailStatus(ctx context.Context, messageId string) (*EmailStatusResponse, error)
- func (r *EmailsResource) ListEmailEvents(ctx context.Context, messageId string) (*ListEmailEventsResponse, error)
- func (r *EmailsResource) SendEmail(ctx context.Context, request *SendEmailRequest) (*SendEmailResponse, error)
- type EnrollSequenceRequest
- type EnrollSequenceResponse
- type EventRequest
- type EventsResource
- type FunnelStepInfo
- type FunnelsResource
- type GetContactStatsResponse
- type GetEmailStatsResponse
- type GetRevenueStatsResponse
- type GlobalUnsubscribeRequest
- type HandlerConfig
- type HandlerOption
- func WithConfirmExpiredRedirect(url string) HandlerOption
- func WithConfirmRedirect(url string) HandlerOption
- func WithLLMClient(llm *LLMClient) HandlerOption
- func WithStripeWebhookSecret(secret string) HandlerOption
- func WithUnsubscribeRedirect(url string) HandlerOption
- func WithWSCheckOrigin(fn func(r *http.Request) bool) HandlerOption
- type LLMChatRequest
- type LLMChatResponse
- type LLMClient
- func (c *LLMClient) Chat(ctx context.Context, req ChatRequest) (*ChatResponse, error)
- func (c *LLMClient) ChatStream(ctx context.Context, req ChatRequest, callback StreamCallback) (*ChatResponse, error)
- func (c *LLMClient) Close() error
- func (c *LLMClient) NewChatSession(ctx context.Context, req ChatRequest) (*ChatSession, error)
- type LLMConfigResponse
- type LLMMessage
- type LLMOption
- type ListContactActivityResponse
- type ListCustomerInvoicesResponse
- type ListCustomerOrdersResponse
- type ListCustomerPaymentsResponse
- type ListCustomerSubscriptionsResponse
- type ListEmailEventsResponse
- type ListSDKAuthorsResponse
- type ListSDKContentCategoriesResponse
- type ListSDKContentPagesResponse
- type ListSDKContentPostsResponse
- type ListSDKNavigationMenusResponse
- type ListSequenceEnrollmentsResponse
- type ListWebhookLogsResponse
- type ListWebhooksResponse
- type ListsResource
- type LlmResource
- type OfferRequest
- type OfferResponse
- type OffersResource
- type OrderRequest
- type OrderResponse
- type OrdersResource
- type OrgMember
- type OrgMembersResponse
- type PauseSequenceRequest
- type PendingInvite
- type PortalRequest
- type PortalResponse
- type PriceCurrencyInfo
- type PriceTierInfo
- type ProductFeature
- type ProductsResource
- type QuizInfo
- type QuizOption
- type QuizQuestion
- type QuizSubmitRequest
- type QuizSubmitResponse
- type QuizzesResource
- type RegisterWebhookRequest
- type RegisterWebhookResponse
- type RemoveContactTagsRequest
- type Response
- type ResumeSequenceRequest
- type RevenueStatsPoint
- type SDKAuthCustomerInfo
- type SDKAuthResponse
- type SDKAuthorInfo
- type SDKChangePasswordRequest
- type SDKContactInfo
- type SDKContentCategoryInfo
- type SDKContentPageInfo
- type SDKContentPostInfo
- type SDKCustomerInfo
- type SDKForgotPasswordRequest
- type SDKInviteTeamMemberRequest
- type SDKInvoiceInfo
- type SDKLoginRequest
- type SDKNavigationItem
- type SDKNavigationMenu
- type SDKOrderInfo
- type SDKOrderItem
- type SDKPaymentInfo
- type SDKRefreshTokenRequest
- type SDKRegisterRequest
- type SDKResetPasswordRequest
- type SDKSiteSettings
- type SDKSubscriptionInfo
- type SDKUpdateCustomerRequest
- type SDKUpdateTeamMemberRoleRequest
- type SDKVerifyEmailRequest
- type SendEmailRequest
- type SendEmailResponse
- type SequenceEnrollmentInfo
- type SequencesResource
- func (r *SequencesResource) EnrollInSequence(ctx context.Context, request *EnrollSequenceRequest) (*EnrollSequenceResponse, error)
- func (r *SequencesResource) GetSequenceEnrollments(ctx context.Context, email string, sequenceSlug string) (*ListSequenceEnrollmentsResponse, error)
- func (r *SequencesResource) PauseSequenceEnrollment(ctx context.Context, request *PauseSequenceRequest) (*Response, error)
- func (r *SequencesResource) ResumeSequenceEnrollment(ctx context.Context, request *ResumeSequenceRequest) (*Response, error)
- func (r *SequencesResource) UnenrollFromSequence(ctx context.Context, request *UnenrollSequenceRequest) (*Response, error)
- type SiteResource
- func (r *SiteResource) GetAuthor(ctx context.Context, id string) (*SDKAuthorInfo, error)
- func (r *SiteResource) GetNavigationMenu(ctx context.Context, slug string) (*SDKNavigationMenu, error)
- func (r *SiteResource) GetSiteSettings(ctx context.Context) (*SDKSiteSettings, error)
- func (r *SiteResource) ListAuthors(ctx context.Context) (*ListSDKAuthorsResponse, error)
- func (r *SiteResource) ListNavigationMenus(ctx context.Context, location string) (*ListSDKNavigationMenusResponse, error)
- type StatsOverviewResponse
- type StatsResource
- func (r *StatsResource) GetContactStats(ctx context.Context, startDate string, endDate string, groupBy string) (*GetContactStatsResponse, error)
- func (r *StatsResource) GetEmailStats(ctx context.Context, startDate string, endDate string, groupBy string) (*GetEmailStatsResponse, error)
- func (r *StatsResource) GetRevenueStats(ctx context.Context, startDate string, endDate string, groupBy string) (*GetRevenueStatsResponse, error)
- func (r *StatsResource) GetStatsOverview(ctx context.Context, startDate string, endDate string) (*StatsOverviewResponse, error)
- type StreamCallback
- type StreamChunk
- type SubscribeRequest
- type SubscriptionRequest
- type SubscriptionResponse
- type TeamResource
- func (r *TeamResource) AcceptInvite(ctx context.Context, request *AcceptInviteRequest) (*AcceptInviteResponse, error)
- func (r *TeamResource) InviteTeamMember(ctx context.Context, request *SDKInviteTeamMemberRequest) (*Response, error)
- func (r *TeamResource) ListTeamMembers(ctx context.Context) (*OrgMembersResponse, error)
- func (r *TeamResource) RemoveTeamMember(ctx context.Context, id string) (*Response, error)
- func (r *TeamResource) UpdateTeamMemberRole(ctx context.Context, id string, request *SDKUpdateTeamMemberRoleRequest) (*Response, error)
- func (r *TeamResource) ValidateInvite(ctx context.Context, token string) (*ValidateInviteTokenResponse, error)
- type TestWebhookResponse
- type TrackClickRequest
- type TrackConfirmRequest
- type TrackConfirmResponse
- type TrackOpenRequest
- type TrackUnsubscribeRequest
- type TrackingResource
- func (r *TrackingResource) TrackClick(ctx context.Context, request *TrackClickRequest) (*Response, error)
- func (r *TrackingResource) TrackConfirm(ctx context.Context, request *TrackConfirmRequest) (*TrackConfirmResponse, error)
- func (r *TrackingResource) TrackOpen(ctx context.Context, request *TrackOpenRequest) (*Response, error)
- func (r *TrackingResource) TrackUnsubscribe(ctx context.Context, request *TrackUnsubscribeRequest) (*Response, error)
- type UnenrollSequenceRequest
- type UpdateContactRequest
- type UpdateWebhookRequest
- type UsageRequest
- type ValidateInviteTokenResponse
- type WSAbortRequest
- type WSChunkResponse
- type WSCompletionResponse
- type WSConfig
- type WSErrorResponse
- type WSMessage
- type WSOption
- type WSStartRequest
- type WSStartedResponse
- type WSToolCallResponse
- type WSToolResult
- type WSUserMessage
- type WebhookInfo
- type WebhookLogInfo
- type WebhooksResource
- func (r *WebhooksResource) DeleteWebhook(ctx context.Context, id string) (*Response, error)
- func (r *WebhooksResource) GetWebhook(ctx context.Context, id string) (*WebhookInfo, error)
- func (r *WebhooksResource) ListWebhookLogs(ctx context.Context, id string, limit int) (*ListWebhookLogsResponse, error)
- func (r *WebhooksResource) ListWebhooks(ctx context.Context) (*ListWebhooksResponse, error)
- func (r *WebhooksResource) RegisterWebhook(ctx context.Context, request *RegisterWebhookRequest) (*RegisterWebhookResponse, error)
- func (r *WebhooksResource) TestWebhook(ctx context.Context, id string) (*TestWebhookResponse, error)
- func (r *WebhooksResource) UpdateWebhook(ctx context.Context, id string, request *UpdateWebhookRequest) (*WebhookInfo, error)
- type WorkshopAgendaDay
- type WorkshopEventInfo
- type WorkshopsResource
Constants ¶
const ( WSMsgTypeStart = "start" WSMsgTypeMessage = "message" WSMsgTypeAbort = "abort" WSMsgTypeChunk = "chunk" WSMsgTypeCompletion = "completion" WSMsgTypeError = "error" WSMsgTypeStarted = "started" WSMsgTypeToolCall = "tool_call" WSMsgTypeToolResult = "tool_result" )
WebSocket message types for LLM chat
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptInviteRequest ¶
type AcceptInviteRequest struct {
Token string `json:"token"`
Password string `json:"password,omitempty"`
Name string `json:"name,omitempty"`
}
AcceptInviteRequest represents the AcceptInviteRequest type.
type AcceptInviteResponse ¶
type AcceptInviteResponse struct {
Message string `json:"message"`
OrgID string `json:"org_id"`
OrgName string `json:"org_name"`
OrgSlug string `json:"org_slug"`
Role string `json:"role"`
}
AcceptInviteResponse represents the AcceptInviteResponse type.
type AddContactTagsRequest ¶
type AddContactTagsRequest struct {
Tags []string `json:"tags"`
}
AddContactTagsRequest represents the AddContactTagsRequest type.
type AuthResource ¶
type AuthResource struct {
// contains filtered or unexported fields
}
AuthResource provides access to auth resources.
func (*AuthResource) ChangePassword ¶
func (r *AuthResource) ChangePassword(ctx context.Context, request *SDKChangePasswordRequest) (*Response, error)
ChangePassword
func (*AuthResource) ForgotPassword ¶
func (r *AuthResource) ForgotPassword(ctx context.Context, request *SDKForgotPasswordRequest) (*Response, error)
ForgotPassword
func (*AuthResource) Login ¶
func (r *AuthResource) Login(ctx context.Context, request *SDKLoginRequest) (*SDKAuthResponse, error)
Login
func (*AuthResource) RefreshToken ¶
func (r *AuthResource) RefreshToken(ctx context.Context, request *SDKRefreshTokenRequest) (*SDKAuthResponse, error)
RefreshToken
func (*AuthResource) Register ¶
func (r *AuthResource) Register(ctx context.Context, request *SDKRegisterRequest) (*SDKAuthResponse, error)
Register
func (*AuthResource) ResetPassword ¶
func (r *AuthResource) ResetPassword(ctx context.Context, request *SDKResetPasswordRequest) (*Response, error)
ResetPassword
func (*AuthResource) VerifyEmail ¶
func (r *AuthResource) VerifyEmail(ctx context.Context, request *SDKVerifyEmailRequest) (*Response, error)
VerifyEmail
type BillingPriceInfo ¶
type BillingPriceInfo struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
ProductID string `json:"product_id"`
ProductName string `json:"product_name,omitempty"`
StripePriceID string `json:"stripe_price_id,omitempty"`
Provider string `json:"provider,omitempty"`
ProviderPriceID string `json:"provider_price_id,omitempty"`
Nickname string `json:"nickname,omitempty"`
DisplayName string `json:"display_name,omitempty"`
UnitAmountCents int64 `json:"unit_amount_cents"`
CompareAtCents int64 `json:"compare_at_cents,omitempty"`
Currency string `json:"currency"`
RecurringInterval string `json:"recurring_interval,omitempty"`
RecurringIntervalCount int `json:"recurring_interval_count,omitempty"`
UsageType string `json:"usage_type"`
Active bool `json:"active"`
PriceType string `json:"price_type"`
BillingModel string `json:"billing_model"`
MinimumQuantity int `json:"minimum_quantity,omitempty"`
MaximumQuantity int `json:"maximum_quantity,omitempty"`
TrialPeriodDays int `json:"trial_period_days,omitempty"`
IncludedUnits int `json:"included_units,omitempty"`
OverageUnitAmountCents int64 `json:"overage_unit_amount_cents,omitempty"`
FeatureLimits map[string]interface{} `json:"feature_limits,omitempty"`
DisplayOrder int `json:"display_order"`
Highlighted bool `json:"highlighted"`
Tiers []PriceTierInfo `json:"tiers,omitempty"`
Currencies []PriceCurrencyInfo `json:"currencies,omitempty"`
CreatedAt string `json:"created_at"`
}
BillingPriceInfo represents the BillingPriceInfo type.
type BillingProductInfo ¶
type BillingProductInfo struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
Slug string `json:"slug,omitempty"`
StripeProductID string `json:"stripe_product_id,omitempty"`
Provider string `json:"provider,omitempty"`
ProviderProductID string `json:"provider_product_id,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Tagline string `json:"tagline,omitempty"`
Type string `json:"type"`
Category string `json:"category"`
DeliveryMethod string `json:"delivery_method,omitempty"`
Active bool `json:"active"`
Features []ProductFeature `json:"features,omitempty"`
WhatsIncluded []string `json:"whats_included,omitempty"`
WhoItsFor []string `json:"who_its_for,omitempty"`
TaxCode string `json:"tax_code,omitempty"`
UnitLabel string `json:"unit_label,omitempty"`
Shippable bool `json:"shippable"`
Images []string `json:"images,omitempty"`
InventoryType string `json:"inventory_type,omitempty"`
InventoryCount int `json:"inventory_count,omitempty"`
LowStockThreshold int `json:"low_stock_threshold,omitempty"`
DisplayOrder int `json:"display_order"`
Highlighted bool `json:"highlighted"`
CtaText string `json:"cta_text,omitempty"`
Prices []BillingPriceInfo `json:"prices,omitempty"`
EmailSequenceID int64 `json:"email_sequence_id,omitempty"`
CreatedAt string `json:"created_at"`
}
BillingProductInfo represents the BillingProductInfo type.
type BillingResource ¶
type BillingResource struct {
// contains filtered or unexported fields
}
BillingResource provides access to billing resources.
func (*BillingResource) CancelSubscription ¶
CancelSubscription
func (*BillingResource) CreateCheckoutSession ¶
func (r *BillingResource) CreateCheckoutSession(ctx context.Context, request *CheckoutRequest) (*CheckoutResponse, error)
CreateCheckoutSession
func (*BillingResource) CreateCustomer ¶
func (r *BillingResource) CreateCustomer(ctx context.Context, request *CustomerRequest) (*CustomerResponse, error)
CreateCustomer
func (*BillingResource) CreateSubscription ¶
func (r *BillingResource) CreateSubscription(ctx context.Context, request *SubscriptionRequest) (*SubscriptionResponse, error)
CreateSubscription
func (*BillingResource) GetCustomerPortal ¶
func (r *BillingResource) GetCustomerPortal(ctx context.Context, request *PortalRequest) (*PortalResponse, error)
GetCustomerPortal
func (*BillingResource) RecordUsage ¶
func (r *BillingResource) RecordUsage(ctx context.Context, request *UsageRequest) (*Response, error)
RecordUsage
type ChatMessage ¶
type ChatMessage struct {
Role string `json:"role"` // "user", "assistant", "system"
Content string `json:"content"`
}
ChatMessage represents a message in a conversation.
type ChatRequest ¶
type ChatRequest struct {
Messages []ChatMessage
SystemPrompt string
Model string // "haiku", "sonnet", "opus" or full model ID
MaxTokens int32
Temperature float32
}
ChatRequest represents an LLM chat request.
type ChatResponse ¶
type ChatResponse struct {
Content string
Model string
InputTokens int64
OutputTokens int64
CostUSD float64
LatencyMs int64
StopReason string
}
ChatResponse represents an LLM chat response.
type ChatSession ¶
type ChatSession struct {
// contains filtered or unexported fields
}
ChatSession represents an active chat session for bidirectional streaming.
func (*ChatSession) Abort ¶
func (s *ChatSession) Abort(reason string) error
Abort aborts the current generation.
func (*ChatSession) Send ¶
func (s *ChatSession) Send(ctx context.Context, content string, callback StreamCallback) (*ChatResponse, error)
Send sends a user message and streams the response.
type CheckoutItem ¶
CheckoutItem represents the CheckoutItem type.
type CheckoutRequest ¶
type CheckoutRequest struct {
CustomerEmail string `json:"customer_email"`
LineItems []CheckoutItem `json:"line_items"`
Mode string `json:"mode"`
SuccessUrl string `json:"success_url"`
CancelUrl string `json:"cancel_url,omitempty"`
Embedded bool `json:"embedded,omitempty"`
ReturnUrl string `json:"return_url,omitempty"`
}
CheckoutRequest represents the CheckoutRequest type.
type CheckoutResponse ¶
type CheckoutResponse struct {
SessionID string `json:"session_id"`
CheckoutUrl string `json:"checkout_url,omitempty"`
ClientSecret string `json:"client_secret,omitempty"`
}
CheckoutResponse represents the CheckoutResponse type.
type Client ¶
type Client struct {
// Lists provides access to lists resources.
Lists *ListsResource
// Orders provides access to orders resources.
Orders *OrdersResource
// Auth provides access to auth resources.
Auth *AuthResource
// Emails provides access to emails resources.
Emails *EmailsResource
// Stats provides access to stats resources.
Stats *StatsResource
// Team provides access to team resources.
Team *TeamResource
// Webhooks provides access to webhooks resources.
Webhooks *WebhooksResource
// Workshops provides access to workshops resources.
Workshops *WorkshopsResource
// Billing provides access to billing resources.
Billing *BillingResource
// Customers provides access to customers resources.
Customers *CustomersResource
// Sequences provides access to sequences resources.
Sequences *SequencesResource
// Site provides access to site resources.
Site *SiteResource
// Events provides access to events resources.
Events *EventsResource
// Offers provides access to offers resources.
Offers *OffersResource
// Products provides access to products resources.
Products *ProductsResource
// Quizzes provides access to quizzes resources.
Quizzes *QuizzesResource
// Content provides access to content resources.
Content *ContentResource
// Tracking provides access to tracking resources.
Tracking *TrackingResource
// Contacts provides access to contacts resources.
Contacts *ContactsResource
// Funnels provides access to funnels resources.
Funnels *FunnelsResource
// Llm provides access to llm resources.
Llm *LlmResource
// contains filtered or unexported fields
}
Client is the Levee API client.
func NewClient ¶
func NewClient(apiKey string, baseURL string, opts ...ClientOption) (*Client, error)
NewClient creates a new Levee API client. baseURL is required - this is a self-hosted system, use your Levee instance URL.
func (*Client) ConfirmEmail ¶
ConfirmEmail confirms an email subscription (double opt-in).
func (*Client) ForwardSESWebhook ¶
ForwardSESWebhook forwards an SES webhook payload to Levee.
func (*Client) ForwardStripeWebhook ¶
ForwardStripeWebhook forwards a Stripe webhook payload to Levee.
func (*Client) HandleChatWebSocket ¶
func (c *Client) HandleChatWebSocket(llm *LLMClient, opts ...WSOption) http.HandlerFunc
HandleChatWebSocket returns a handler for WebSocket LLM chat. This bridges WebSocket connections to the gRPC LLM stream. Route: GET /your-prefix/ws/chat (upgrades to WebSocket)
func (*Client) HandleClickTracking ¶
func (c *Client) HandleClickTracking(cfg *HandlerConfig) http.HandlerFunc
HandleClickTracking returns a handler for email click tracking. Records the click and redirects to the destination URL. Route: GET /your-prefix/e/c/:token?url=...
func (*Client) HandleConfirmEmail ¶
func (c *Client) HandleConfirmEmail(cfg *HandlerConfig) http.HandlerFunc
HandleConfirmEmail returns a handler for double opt-in email confirmation. Route: GET /your-prefix/confirm-email?token=...
func (*Client) HandleOpenTracking ¶
func (c *Client) HandleOpenTracking(cfg *HandlerConfig) http.HandlerFunc
HandleOpenTracking returns a handler for email open tracking. Serves a 1x1 transparent GIF and records the open event. Route: GET /your-prefix/e/o/:token
func (*Client) HandleSESWebhook ¶
func (c *Client) HandleSESWebhook(cfg *HandlerConfig) http.HandlerFunc
HandleSESWebhook returns a handler for AWS SES bounce/complaint notifications. Handles SNS subscription confirmation and forwards events to Levee API. Route: POST /your-prefix/webhooks/ses
func (*Client) HandleStripeWebhook ¶
func (c *Client) HandleStripeWebhook(cfg *HandlerConfig) http.HandlerFunc
HandleStripeWebhook returns a handler for Stripe webhook events. Verifies signature and forwards to Levee API. Route: POST /your-prefix/webhooks/stripe
func (*Client) HandleUnsubscribe ¶
func (c *Client) HandleUnsubscribe(cfg *HandlerConfig) http.HandlerFunc
HandleUnsubscribe returns a handler for one-click unsubscribe. Records the unsubscribe and redirects to the configured URL. Route: GET /your-prefix/e/u/:token
func (*Client) RecordClick ¶
RecordClick records an email click event.
func (*Client) RecordOpen ¶
RecordOpen records an email open event.
func (*Client) RecordUnsubscribe ¶
RecordUnsubscribe records an unsubscribe event.
func (*Client) RegisterHandlers ¶
func (c *Client) RegisterHandlers(mux *http.ServeMux, prefix string, opts ...HandlerOption)
RegisterHandlers registers all Levee HTTP handlers on the given mux with the specified prefix. Example: client.RegisterHandlers(mux, "/levee") registers handlers at /levee/e/o/:token, etc.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a function that configures the Client.
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout sets the timeout for HTTP requests.
type ConfirmEmailResponse ¶
type ConfirmEmailResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
RedirectURL string `json:"redirect_url,omitempty"`
}
ConfirmEmailResponse is the response from confirming an email.
type ContactActivityInfo ¶
type ContactActivityInfo struct {
Event string `json:"event"`
Timestamp string `json:"timestamp"`
Details string `json:"details,omitempty"`
}
ContactActivityInfo represents the ContactActivityInfo type.
type ContactRequest ¶
type ContactRequest struct {
Email string `json:"email"`
Name string `json:"name,omitempty"`
Phone string `json:"phone,omitempty"`
Company string `json:"company,omitempty"`
Employees string `json:"employees,omitempty"`
Message string `json:"message,omitempty"`
Source string `json:"source,omitempty"`
Tags []string `json:"tags,omitempty"`
FunnelSlug string `json:"funnel_slug,omitempty"`
ListSlug string `json:"list_slug,omitempty"`
Score bool `json:"score,omitempty"`
UtmSource string `json:"utm_source,omitempty"`
UtmMedium string `json:"utm_medium,omitempty"`
UtmCampaign string `json:"utm_campaign,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
}
ContactRequest represents the ContactRequest type.
type ContactResponse ¶
type ContactResponse struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Score int `json:"score,omitempty"`
Qualified bool `json:"qualified,omitempty"`
Reasoning string `json:"reasoning,omitempty"`
NextSteps string `json:"next_steps,omitempty"`
}
ContactResponse represents the ContactResponse type.
type ContactStatsPoint ¶
type ContactStatsPoint struct {
Date string `json:"date"`
NewContacts int `json:"new_contacts"`
Unsubscribed int `json:"unsubscribed"`
Bounced int `json:"bounced"`
NetGrowth int `json:"net_growth"`
}
ContactStatsPoint represents the ContactStatsPoint type.
type ContactsResource ¶
type ContactsResource struct {
// contains filtered or unexported fields
}
ContactsResource provides access to contacts resources.
func (*ContactsResource) AddContactTags ¶
func (r *ContactsResource) AddContactTags(ctx context.Context, id string, request *AddContactTagsRequest) (*Response, error)
AddContactTags
func (*ContactsResource) CreateContact ¶
func (r *ContactsResource) CreateContact(ctx context.Context, request *ContactRequest) (*ContactResponse, error)
CreateContact
func (*ContactsResource) GetContact ¶
func (r *ContactsResource) GetContact(ctx context.Context, id string) (*SDKContactInfo, error)
GetContact
func (*ContactsResource) GlobalUnsubscribe ¶
func (r *ContactsResource) GlobalUnsubscribe(ctx context.Context, request *GlobalUnsubscribeRequest) (*Response, error)
GlobalUnsubscribe
func (*ContactsResource) ListContactActivity ¶
func (r *ContactsResource) ListContactActivity(ctx context.Context, id string, limit int) (*ListContactActivityResponse, error)
ListContactActivity
func (*ContactsResource) RemoveContactTags ¶
func (r *ContactsResource) RemoveContactTags(ctx context.Context, id string, request *RemoveContactTagsRequest) (*Response, error)
RemoveContactTags
func (*ContactsResource) UpdateContact ¶
func (r *ContactsResource) UpdateContact(ctx context.Context, id string, request *UpdateContactRequest) (*SDKContactInfo, error)
UpdateContact
type ContentResource ¶
type ContentResource struct {
// contains filtered or unexported fields
}
ContentResource provides access to content resources.
func (*ContentResource) GetContentPage ¶
func (r *ContentResource) GetContentPage(ctx context.Context, slug string) (*SDKContentPageInfo, error)
GetContentPage
func (*ContentResource) GetContentPost ¶
func (r *ContentResource) GetContentPost(ctx context.Context, slug string) (*SDKContentPostInfo, error)
GetContentPost
func (*ContentResource) ListContentCategories ¶
func (r *ContentResource) ListContentCategories(ctx context.Context) (*ListSDKContentCategoriesResponse, error)
ListContentCategories
func (*ContentResource) ListContentPages ¶
func (r *ContentResource) ListContentPages(ctx context.Context, page int, pageSize int) (*ListSDKContentPagesResponse, error)
ListContentPages
func (*ContentResource) ListContentPosts ¶
func (r *ContentResource) ListContentPosts(ctx context.Context, page int, pageSize int, categorySlug string) (*ListSDKContentPostsResponse, error)
ListContentPosts
type CustomerRequest ¶
type CustomerRequest struct {
Email string `json:"email"`
Name string `json:"name,omitempty"`
Phone string `json:"phone,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
}
CustomerRequest represents the CustomerRequest type.
type CustomerResponse ¶
type CustomerResponse struct {
ID string `json:"id"`
StripeCustomerID string `json:"stripe_customer_id"`
Email string `json:"email"`
Name string `json:"name"`
}
CustomerResponse represents the CustomerResponse type.
type CustomersResource ¶
type CustomersResource struct {
// contains filtered or unexported fields
}
CustomersResource provides access to customers resources.
func (*CustomersResource) DeleteCustomer ¶
DeleteCustomer
func (*CustomersResource) GetCustomerByEmail ¶
func (r *CustomersResource) GetCustomerByEmail(ctx context.Context, email string) (*SDKCustomerInfo, error)
GetCustomerByEmail
func (*CustomersResource) GetCustomerById ¶
func (r *CustomersResource) GetCustomerById(ctx context.Context, id string) (*SDKCustomerInfo, error)
GetCustomerById
func (*CustomersResource) ListCustomerInvoices ¶
func (r *CustomersResource) ListCustomerInvoices(ctx context.Context, email string, limit int) (*ListCustomerInvoicesResponse, error)
ListCustomerInvoices
func (*CustomersResource) ListCustomerInvoicesById ¶
func (r *CustomersResource) ListCustomerInvoicesById(ctx context.Context, id string, limit int) (*ListCustomerInvoicesResponse, error)
ListCustomerInvoicesById
func (*CustomersResource) ListCustomerOrders ¶
func (r *CustomersResource) ListCustomerOrders(ctx context.Context, email string, limit int) (*ListCustomerOrdersResponse, error)
ListCustomerOrders
func (*CustomersResource) ListCustomerOrdersById ¶
func (r *CustomersResource) ListCustomerOrdersById(ctx context.Context, id string, limit int) (*ListCustomerOrdersResponse, error)
ListCustomerOrdersById
func (*CustomersResource) ListCustomerPayments ¶
func (r *CustomersResource) ListCustomerPayments(ctx context.Context, email string, limit int) (*ListCustomerPaymentsResponse, error)
ListCustomerPayments
func (*CustomersResource) ListCustomerPaymentsById ¶
func (r *CustomersResource) ListCustomerPaymentsById(ctx context.Context, id string, limit int) (*ListCustomerPaymentsResponse, error)
ListCustomerPaymentsById
func (*CustomersResource) ListCustomerSubscriptions ¶
func (r *CustomersResource) ListCustomerSubscriptions(ctx context.Context, email string) (*ListCustomerSubscriptionsResponse, error)
ListCustomerSubscriptions
func (*CustomersResource) ListCustomerSubscriptionsById ¶
func (r *CustomersResource) ListCustomerSubscriptionsById(ctx context.Context, id string) (*ListCustomerSubscriptionsResponse, error)
ListCustomerSubscriptionsById
func (*CustomersResource) UpdateCustomer ¶
func (r *CustomersResource) UpdateCustomer(ctx context.Context, id string, request *SDKUpdateCustomerRequest) (*SDKCustomerInfo, error)
UpdateCustomer
type EmailEventInfo ¶
type EmailEventInfo struct {
Event string `json:"event"`
Timestamp string `json:"timestamp"`
Data string `json:"data,omitempty"`
}
EmailEventInfo represents the EmailEventInfo type.
type EmailStatsPoint ¶
type EmailStatsPoint struct {
Date string `json:"date"`
Sent int `json:"sent"`
Delivered int `json:"delivered"`
Opened int `json:"opened"`
Clicked int `json:"clicked"`
Bounced int `json:"bounced"`
OpenRate float64 `json:"open_rate"`
ClickRate float64 `json:"click_rate"`
}
EmailStatsPoint represents the EmailStatsPoint type.
type EmailStatusResponse ¶
type EmailStatusResponse struct {
MessageID string `json:"message_id"`
To string `json:"to"`
Subject string `json:"subject"`
Status string `json:"status"`
SentAt string `json:"sent_at,omitempty"`
DeliveredAt string `json:"delivered_at,omitempty"`
OpenedAt string `json:"opened_at,omitempty"`
ClickedAt string `json:"clicked_at,omitempty"`
BouncedAt string `json:"bounced_at,omitempty"`
BounceType string `json:"bounce_type,omitempty"`
Opens int `json:"opens"`
Clicks int `json:"clicks"`
}
EmailStatusResponse represents the EmailStatusResponse type.
type EmailsResource ¶
type EmailsResource struct {
// contains filtered or unexported fields
}
EmailsResource provides access to emails resources.
func (*EmailsResource) GetEmailStatus ¶
func (r *EmailsResource) GetEmailStatus(ctx context.Context, messageId string) (*EmailStatusResponse, error)
GetEmailStatus
func (*EmailsResource) ListEmailEvents ¶
func (r *EmailsResource) ListEmailEvents(ctx context.Context, messageId string) (*ListEmailEventsResponse, error)
ListEmailEvents
func (*EmailsResource) SendEmail ¶
func (r *EmailsResource) SendEmail(ctx context.Context, request *SendEmailRequest) (*SendEmailResponse, error)
SendEmail
type EnrollSequenceRequest ¶
type EnrollSequenceRequest struct {
SequenceSlug string `json:"sequence_slug"`
Email string `json:"email"`
Variables map[string]string `json:"variables,omitempty"`
StartAtStep int `json:"start_at_step,omitempty"`
ScheduledFor string `json:"scheduled_for,omitempty"`
}
EnrollSequenceRequest represents the EnrollSequenceRequest type.
type EnrollSequenceResponse ¶
type EnrollSequenceResponse struct {
Success bool `json:"success"`
EnrollmentID string `json:"enrollment_id"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
}
EnrollSequenceResponse represents the EnrollSequenceResponse type.
type EventRequest ¶
type EventRequest struct {
Event string `json:"event"`
Email string `json:"email,omitempty"`
VisitorID string `json:"visitor_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
Page string `json:"page,omitempty"`
Referrer string `json:"referrer,omitempty"`
FunnelSlug string `json:"funnel_slug,omitempty"`
FunnelStep string `json:"funnel_step,omitempty"`
ScrollDepth int `json:"scroll_depth,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
UtmSource string `json:"utm_source,omitempty"`
UtmMedium string `json:"utm_medium,omitempty"`
UtmCampaign string `json:"utm_campaign,omitempty"`
}
EventRequest represents the EventRequest type.
type EventsResource ¶
type EventsResource struct {
// contains filtered or unexported fields
}
EventsResource provides access to events resources.
func (*EventsResource) TrackEvent ¶
func (r *EventsResource) TrackEvent(ctx context.Context, request *EventRequest) (*Response, error)
TrackEvent
type FunnelStepInfo ¶
type FunnelStepInfo struct {
ID int64 `json:"id"`
FunnelID int64 `json:"funnel_id"`
FunnelSlug string `json:"funnel_slug,omitempty"`
Slug string `json:"slug"`
StepType string `json:"step_type"`
Position int `json:"position"`
Title string `json:"title"`
Headline string `json:"headline,omitempty"`
Subheadline string `json:"subheadline,omitempty"`
Content map[string]interface{} `json:"content,omitempty"`
ProductID string `json:"product_id,omitempty"`
Product BillingProductInfo `json:"product,omitempty"`
OrderBumpProductID string `json:"order_bump_product_id,omitempty"`
OrderBumpProduct BillingProductInfo `json:"order_bump_product,omitempty"`
OrderBumpHeadline string `json:"order_bump_headline,omitempty"`
OrderBumpDescription string `json:"order_bump_description,omitempty"`
NextStepID int64 `json:"next_step_id,omitempty"`
DeclineStepID int64 `json:"decline_step_id,omitempty"`
SuccessRedirect string `json:"success_redirect,omitempty"`
EmailSequenceID int64 `json:"email_sequence_id,omitempty"`
TriggerEvent string `json:"trigger_event,omitempty"`
IsActive bool `json:"is_active"`
CreatedAt string `json:"created_at"`
}
FunnelStepInfo represents the FunnelStepInfo type.
type FunnelsResource ¶
type FunnelsResource struct {
// contains filtered or unexported fields
}
FunnelsResource provides access to funnels resources.
func (*FunnelsResource) GetFunnelStep ¶
func (r *FunnelsResource) GetFunnelStep(ctx context.Context, slug string) (*FunnelStepInfo, error)
GetFunnelStep
type GetContactStatsResponse ¶
type GetContactStatsResponse struct {
Stats []ContactStatsPoint `json:"stats"`
TotalActive int `json:"total_active"`
TotalUnsubscribed int `json:"total_unsubscribed"`
TotalBounced int `json:"total_bounced"`
NetGrowth int `json:"net_growth"`
}
GetContactStatsResponse represents the GetContactStatsResponse type.
type GetEmailStatsResponse ¶
type GetEmailStatsResponse struct {
Stats []EmailStatsPoint `json:"stats"`
TotalSent int `json:"total_sent"`
TotalDelivered int `json:"total_delivered"`
TotalOpened int `json:"total_opened"`
TotalClicked int `json:"total_clicked"`
TotalBounced int `json:"total_bounced"`
AvgOpenRate float64 `json:"avg_open_rate"`
AvgClickRate float64 `json:"avg_click_rate"`
}
GetEmailStatsResponse represents the GetEmailStatsResponse type.
type GetRevenueStatsResponse ¶
type GetRevenueStatsResponse struct {
Stats []RevenueStatsPoint `json:"stats"`
TotalRevenue int64 `json:"total_revenue"`
TotalOrders int `json:"total_orders"`
TotalSubscriptions int `json:"total_subscriptions"`
TotalChurned int `json:"total_churned"`
Mrr int64 `json:"mrr"`
}
GetRevenueStatsResponse represents the GetRevenueStatsResponse type.
type GlobalUnsubscribeRequest ¶
type GlobalUnsubscribeRequest struct {
Email string `json:"email"`
Reason string `json:"reason,omitempty"`
}
GlobalUnsubscribeRequest represents the GlobalUnsubscribeRequest type.
type HandlerConfig ¶
type HandlerConfig struct {
// UnsubscribeRedirect is the URL to redirect to after unsubscribe (default: /unsubscribed)
UnsubscribeRedirect string
// ConfirmRedirect is the URL to redirect to after email confirmation (default: /confirmed)
ConfirmRedirect string
// ConfirmExpiredRedirect is the URL to redirect to if confirmation token expired (default: /confirm-expired)
ConfirmExpiredRedirect string
// StripeWebhookSecret is the Stripe webhook signing secret for signature verification
StripeWebhookSecret string
// LLMClient is the optional LLM client for WebSocket chat handler
LLMClient *LLMClient
// WSCheckOrigin is the origin checker for WebSocket connections (nil allows all)
WSCheckOrigin func(r *http.Request) bool
}
HandlerConfig configures the embedded HTTP handlers.
func NewHandlerConfig ¶
func NewHandlerConfig(opts ...HandlerOption) *HandlerConfig
NewHandlerConfig creates a new HandlerConfig with the given options. Use this when registering handlers individually with custom routers.
type HandlerOption ¶
type HandlerOption func(*HandlerConfig)
HandlerOption is a functional option for configuring handlers.
func WithConfirmExpiredRedirect ¶
func WithConfirmExpiredRedirect(url string) HandlerOption
WithConfirmExpiredRedirect sets the redirect URL for expired confirmation tokens.
func WithConfirmRedirect ¶
func WithConfirmRedirect(url string) HandlerOption
WithConfirmRedirect sets the redirect URL after email confirmation.
func WithLLMClient ¶
func WithLLMClient(llm *LLMClient) HandlerOption
WithLLMClient sets the LLM client for WebSocket chat handler.
func WithStripeWebhookSecret ¶
func WithStripeWebhookSecret(secret string) HandlerOption
WithStripeWebhookSecret sets the Stripe webhook signing secret.
func WithUnsubscribeRedirect ¶
func WithUnsubscribeRedirect(url string) HandlerOption
WithUnsubscribeRedirect sets the redirect URL after unsubscribe.
func WithWSCheckOrigin ¶
func WithWSCheckOrigin(fn func(r *http.Request) bool) HandlerOption
WithWSCheckOrigin sets the origin checker for WebSocket connections.
type LLMChatRequest ¶
type LLMChatRequest struct {
Messages []LLMMessage `json:"messages"`
SystemPrompt string `json:"system_prompt,omitempty"`
Model string `json:"model,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
}
LLMChatRequest represents the LLMChatRequest type.
type LLMChatResponse ¶
type LLMChatResponse struct {
Content string `json:"content"`
Model string `json:"model"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CostUsd float64 `json:"cost_usd"`
LatencyMs int64 `json:"latency_ms"`
StopReason string `json:"stop_reason"`
}
LLMChatResponse represents the LLMChatResponse type.
type LLMClient ¶
type LLMClient struct {
// contains filtered or unexported fields
}
LLMClient provides access to the Levee LLM gateway.
func NewLLMClient ¶
NewLLMClient creates a new LLM client.
baseURL is the Levee API URL (e.g., "https://levee.example.com"). TLS is automatically determined from the URL scheme:
- https:// → TLS enabled
- http:// → plaintext (development only)
The gRPC port is auto-discovered from /sdk/v1/llm/config unless explicitly set with WithGRPCAddress.
func (*LLMClient) Chat ¶
func (c *LLMClient) Chat(ctx context.Context, req ChatRequest) (*ChatResponse, error)
Chat sends a simple (non-streaming) chat request.
func (*LLMClient) ChatStream ¶
func (c *LLMClient) ChatStream(ctx context.Context, req ChatRequest, callback StreamCallback) (*ChatResponse, error)
ChatStream sends a message and streams the response via callback. This is a convenience method for simple streaming use cases.
func (*LLMClient) NewChatSession ¶
func (c *LLMClient) NewChatSession(ctx context.Context, req ChatRequest) (*ChatSession, error)
NewChatSession starts a new bidirectional chat session.
type LLMConfigResponse ¶
type LLMConfigResponse struct {
Available bool `json:"available"`
DefaultProvider string `json:"default_provider"`
ConfiguredProviders []string `json:"configured_providers"`
GrpcPort int `json:"grpc_port"`
}
LLMConfigResponse represents the LLMConfigResponse type.
type LLMMessage ¶
LLMMessage represents the LLMMessage type.
type LLMOption ¶
type LLMOption func(*LLMClient)
LLMOption is a functional option for configuring the LLM client.
func WithGRPCAddress ¶
WithGRPCAddress sets the gRPC server address explicitly (host:port). If not set, the address will be auto-discovered from the config endpoint.
func WithLLMHTTPClient ¶
WithLLMHTTPClient sets a custom HTTP client for config API calls.
type ListContactActivityResponse ¶
type ListContactActivityResponse struct {
Activities []ContactActivityInfo `json:"activities"`
}
ListContactActivityResponse represents the ListContactActivityResponse type.
type ListCustomerInvoicesResponse ¶
type ListCustomerInvoicesResponse struct {
Invoices []SDKInvoiceInfo `json:"invoices"`
Total int `json:"total"`
}
ListCustomerInvoicesResponse represents the ListCustomerInvoicesResponse type.
type ListCustomerOrdersResponse ¶
type ListCustomerOrdersResponse struct {
Orders []SDKOrderInfo `json:"orders"`
Total int `json:"total"`
}
ListCustomerOrdersResponse represents the ListCustomerOrdersResponse type.
type ListCustomerPaymentsResponse ¶
type ListCustomerPaymentsResponse struct {
Payments []SDKPaymentInfo `json:"payments"`
Total int `json:"total"`
}
ListCustomerPaymentsResponse represents the ListCustomerPaymentsResponse type.
type ListCustomerSubscriptionsResponse ¶
type ListCustomerSubscriptionsResponse struct {
Subscriptions []SDKSubscriptionInfo `json:"subscriptions"`
}
ListCustomerSubscriptionsResponse represents the ListCustomerSubscriptionsResponse type.
type ListEmailEventsResponse ¶
type ListEmailEventsResponse struct {
Events []EmailEventInfo `json:"events"`
}
ListEmailEventsResponse represents the ListEmailEventsResponse type.
type ListSDKAuthorsResponse ¶
type ListSDKAuthorsResponse struct {
Authors []SDKAuthorInfo `json:"authors"`
}
ListSDKAuthorsResponse represents the ListSDKAuthorsResponse type.
type ListSDKContentCategoriesResponse ¶
type ListSDKContentCategoriesResponse struct {
Categories []SDKContentCategoryInfo `json:"categories"`
}
ListSDKContentCategoriesResponse represents the ListSDKContentCategoriesResponse type.
type ListSDKContentPagesResponse ¶
type ListSDKContentPagesResponse struct {
Pages []SDKContentPageInfo `json:"pages"`
Total int `json:"total"`
}
ListSDKContentPagesResponse represents the ListSDKContentPagesResponse type.
type ListSDKContentPostsResponse ¶
type ListSDKContentPostsResponse struct {
Posts []SDKContentPostInfo `json:"posts"`
Total int `json:"total"`
}
ListSDKContentPostsResponse represents the ListSDKContentPostsResponse type.
type ListSDKNavigationMenusResponse ¶
type ListSDKNavigationMenusResponse struct {
}
ListSDKNavigationMenusResponse represents the ListSDKNavigationMenusResponse type.
type ListSequenceEnrollmentsResponse ¶
type ListSequenceEnrollmentsResponse struct {
Enrollments []SequenceEnrollmentInfo `json:"enrollments"`
}
ListSequenceEnrollmentsResponse represents the ListSequenceEnrollmentsResponse type.
type ListWebhookLogsResponse ¶
type ListWebhookLogsResponse struct {
Logs []WebhookLogInfo `json:"logs"`
}
ListWebhookLogsResponse represents the ListWebhookLogsResponse type.
type ListWebhooksResponse ¶
type ListWebhooksResponse struct {
Webhooks []WebhookInfo `json:"webhooks"`
}
ListWebhooksResponse represents the ListWebhooksResponse type.
type ListsResource ¶
type ListsResource struct {
// contains filtered or unexported fields
}
ListsResource provides access to lists resources.
func (*ListsResource) SubscribeToList ¶
func (r *ListsResource) SubscribeToList(ctx context.Context, slug string, request *SubscribeRequest) (*Response, error)
SubscribeToList
func (*ListsResource) UnsubscribeFromList ¶
func (r *ListsResource) UnsubscribeFromList(ctx context.Context, slug string, request *SubscribeRequest) (*Response, error)
UnsubscribeFromList
type LlmResource ¶
type LlmResource struct {
// contains filtered or unexported fields
}
LlmResource provides access to llm resources.
func (*LlmResource) Chat ¶
func (r *LlmResource) Chat(ctx context.Context, request *LLMChatRequest) (*LLMChatResponse, error)
Chat
func (*LlmResource) Config ¶
func (r *LlmResource) Config(ctx context.Context) (*LLMConfigResponse, error)
Config
type OfferRequest ¶
type OfferRequest struct {
SessionID string `json:"session_id"`
StepSlug string `json:"step_slug"`
Accept bool `json:"accept"`
}
OfferRequest represents the OfferRequest type.
type OfferResponse ¶
type OfferResponse struct {
Success bool `json:"success"`
NextUrl string `json:"next_url,omitempty"`
OrderItemID int64 `json:"order_item_id,omitempty"`
Message string `json:"message,omitempty"`
}
OfferResponse represents the OfferResponse type.
type OffersResource ¶
type OffersResource struct {
// contains filtered or unexported fields
}
OffersResource provides access to offers resources.
func (*OffersResource) ProcessOffer ¶
func (r *OffersResource) ProcessOffer(ctx context.Context, request *OfferRequest) (*OfferResponse, error)
ProcessOffer
type OrderRequest ¶
type OrderRequest struct {
Email string `json:"email"`
Name string `json:"name,omitempty"`
Company string `json:"company,omitempty"`
ProductSlug string `json:"product_slug,omitempty"`
FunnelStepSlug string `json:"funnel_step_slug,omitempty"`
WorkshopID int64 `json:"workshop_id,omitempty"`
IncludeBump bool `json:"include_bump,omitempty"`
AmountCents int64 `json:"amount_cents,omitempty"`
Currency string `json:"currency,omitempty"`
SuccessUrl string `json:"success_url,omitempty"`
CancelUrl string `json:"cancel_url,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
}
OrderRequest represents the OrderRequest type.
type OrderResponse ¶
type OrderResponse struct {
Success bool `json:"success"`
OrderID string `json:"order_id,omitempty"`
OrderNumber string `json:"order_number,omitempty"`
CheckoutUrl string `json:"checkout_url,omitempty"`
SessionID string `json:"session_id,omitempty"`
Message string `json:"message,omitempty"`
}
OrderResponse represents the OrderResponse type.
type OrdersResource ¶
type OrdersResource struct {
// contains filtered or unexported fields
}
OrdersResource provides access to orders resources.
func (*OrdersResource) CreateOrder ¶
func (r *OrdersResource) CreateOrder(ctx context.Context, request *OrderRequest) (*OrderResponse, error)
CreateOrder
type OrgMember ¶
type OrgMember struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
AvatarUrl string `json:"avatar_url,omitempty"`
Role string `json:"role"`
JoinedAt string `json:"joined_at"`
}
OrgMember represents the OrgMember type.
type OrgMembersResponse ¶
type OrgMembersResponse struct {
Members []OrgMember `json:"members"`
PendingInvites []PendingInvite `json:"pending_invites"`
Total int `json:"total"`
}
OrgMembersResponse represents the OrgMembersResponse type.
type PauseSequenceRequest ¶
type PauseSequenceRequest struct {
Email string `json:"email"`
SequenceSlug string `json:"sequence_slug"`
}
PauseSequenceRequest represents the PauseSequenceRequest type.
type PendingInvite ¶
type PendingInvite struct {
Email string `json:"email"`
Name string `json:"name"`
Role string `json:"role"`
InvitedAt string `json:"invited_at"`
ExpiresAt string `json:"expires_at"`
}
PendingInvite represents the PendingInvite type.
type PortalRequest ¶
type PortalRequest struct {
CustomerID string `json:"customer_id"`
ReturnUrl string `json:"return_url"`
}
PortalRequest represents the PortalRequest type.
type PortalResponse ¶
type PortalResponse struct {
PortalUrl string `json:"portal_url"`
}
PortalResponse represents the PortalResponse type.
type PriceCurrencyInfo ¶
type PriceCurrencyInfo struct {
ID string `json:"id"`
PriceID string `json:"price_id"`
Currency string `json:"currency"`
UnitAmountCents int64 `json:"unit_amount_cents"`
CompareAtCents int64 `json:"compare_at_cents,omitempty"`
CreatedAt string `json:"created_at"`
}
PriceCurrencyInfo represents the PriceCurrencyInfo type.
type PriceTierInfo ¶
type PriceTierInfo struct {
ID string `json:"id"`
PriceID string `json:"price_id"`
TierType string `json:"tier_type"`
UpTo int `json:"up_to,omitempty"`
UnitAmountCents int64 `json:"unit_amount_cents"`
FlatAmountCents int64 `json:"flat_amount_cents"`
CreatedAt string `json:"created_at"`
}
PriceTierInfo represents the PriceTierInfo type.
type ProductFeature ¶
type ProductFeature struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Included bool `json:"included"`
}
ProductFeature represents the ProductFeature type.
type ProductsResource ¶
type ProductsResource struct {
// contains filtered or unexported fields
}
ProductsResource provides access to products resources.
func (*ProductsResource) GetProduct ¶
func (r *ProductsResource) GetProduct(ctx context.Context, slug string) (*BillingProductInfo, error)
GetProduct
type QuizInfo ¶
type QuizInfo struct {
Slug string `json:"slug"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Questions []QuizQuestion `json:"questions"`
}
QuizInfo represents the QuizInfo type.
type QuizOption ¶
type QuizOption struct {
ID string `json:"id"`
Label string `json:"label"`
Value string `json:"value"`
Segments []string `json:"segments,omitempty"`
}
QuizOption represents the QuizOption type.
type QuizQuestion ¶
type QuizQuestion struct {
ID string `json:"id"`
Question string `json:"question"`
Type string `json:"type"`
Options []QuizOption `json:"options,omitempty"`
Required bool `json:"required"`
}
QuizQuestion represents the QuizQuestion type.
type QuizSubmitRequest ¶
type QuizSubmitRequest struct {
QuizSlug string `json:"quiz_slug"`
Answers map[string]string `json:"answers"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
}
QuizSubmitRequest represents the QuizSubmitRequest type.
type QuizSubmitResponse ¶
type QuizSubmitResponse struct {
Success bool `json:"success"`
Segments []string `json:"segments"`
RedirectUrl string `json:"redirect_url,omitempty"`
LeadID string `json:"lead_id,omitempty"`
}
QuizSubmitResponse represents the QuizSubmitResponse type.
type QuizzesResource ¶
type QuizzesResource struct {
// contains filtered or unexported fields
}
QuizzesResource provides access to quizzes resources.
func (*QuizzesResource) SubmitQuiz ¶
func (r *QuizzesResource) SubmitQuiz(ctx context.Context, slug string, request *QuizSubmitRequest) (*QuizSubmitResponse, error)
SubmitQuiz
type RegisterWebhookRequest ¶
type RegisterWebhookRequest struct {
Url string `json:"url"`
Events []string `json:"events"`
Secret string `json:"secret,omitempty"`
Active bool `json:"active,omitempty"`
}
RegisterWebhookRequest represents the RegisterWebhookRequest type.
type RegisterWebhookResponse ¶
type RegisterWebhookResponse struct {
Success bool `json:"success"`
WebhookID string `json:"webhook_id"`
Secret string `json:"secret"`
Message string `json:"message,omitempty"`
}
RegisterWebhookResponse represents the RegisterWebhookResponse type.
type RemoveContactTagsRequest ¶
type RemoveContactTagsRequest struct {
Tags []string `json:"tags"`
}
RemoveContactTagsRequest represents the RemoveContactTagsRequest type.
type ResumeSequenceRequest ¶
type ResumeSequenceRequest struct {
Email string `json:"email"`
SequenceSlug string `json:"sequence_slug"`
}
ResumeSequenceRequest represents the ResumeSequenceRequest type.
type RevenueStatsPoint ¶
type RevenueStatsPoint struct {
Date string `json:"date"`
Revenue int64 `json:"revenue"`
OrderCount int `json:"order_count"`
NewSubscriptions int `json:"new_subscriptions"`
Churned int `json:"churned"`
}
RevenueStatsPoint represents the RevenueStatsPoint type.
type SDKAuthCustomerInfo ¶
type SDKAuthCustomerInfo struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name,omitempty"`
EmailVerified bool `json:"email_verified"`
CreatedAt string `json:"created_at"`
Role string `json:"role,omitempty"`
OrgID string `json:"org_id,omitempty"`
}
SDKAuthCustomerInfo represents the SDKAuthCustomerInfo type.
type SDKAuthResponse ¶
type SDKAuthResponse struct {
Token string `json:"token"`
RefreshToken string `json:"refresh_token"`
ExpiresAt string `json:"expires_at"`
Customer SDKAuthCustomerInfo `json:"customer"`
CheckoutUrl string `json:"checkout_url,omitempty"`
}
SDKAuthResponse represents the SDKAuthResponse type.
type SDKAuthorInfo ¶
type SDKAuthorInfo struct {
ID string `json:"id"`
DisplayName string `json:"display_name"`
Bio string `json:"bio,omitempty"`
AvatarUrl string `json:"avatar_url,omitempty"`
WebsiteUrl string `json:"website_url,omitempty"`
TwitterHandle string `json:"twitter_handle,omitempty"`
LinkedinUrl string `json:"linkedin_url,omitempty"`
GithubHandle string `json:"github_handle,omitempty"`
}
SDKAuthorInfo represents the SDKAuthorInfo type.
type SDKChangePasswordRequest ¶
type SDKChangePasswordRequest struct {
Email string `json:"email"`
CurrentPassword string `json:"current_password"`
NewPassword string `json:"new_password"`
}
SDKChangePasswordRequest represents the SDKChangePasswordRequest type.
type SDKContactInfo ¶
type SDKContactInfo struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Phone string `json:"phone,omitempty"`
Company string `json:"company,omitempty"`
Status string `json:"status"`
EmailVerified bool `json:"email_verified"`
Tags []string `json:"tags"`
Lists []string `json:"lists"`
CustomFields map[string]string `json:"custom_fields,omitempty"`
LeadScore int `json:"lead_score,omitempty"`
Source string `json:"source,omitempty"`
EmailsSent int `json:"emails_sent"`
EmailsOpened int `json:"emails_opened"`
EmailsClicked int `json:"emails_clicked"`
LastEmailAt string `json:"last_email_at,omitempty"`
LastOpenAt string `json:"last_open_at,omitempty"`
LastClickAt string `json:"last_click_at,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
SDKContactInfo represents the SDKContactInfo type.
type SDKContentCategoryInfo ¶
type SDKContentCategoryInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description,omitempty"`
}
SDKContentCategoryInfo represents the SDKContentCategoryInfo type.
type SDKContentPageInfo ¶
type SDKContentPageInfo struct {
ID string `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
Content string `json:"content"`
Status string `json:"status"`
MetaTitle string `json:"meta_title,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
FeaturedImage string `json:"featured_image,omitempty"`
TemplateName string `json:"template_name,omitempty"`
TemplateSlug string `json:"template_slug,omitempty"`
CreatedAt string `json:"created_at"`
PublishedAt string `json:"published_at,omitempty"`
}
SDKContentPageInfo represents the SDKContentPageInfo type.
type SDKContentPostInfo ¶
type SDKContentPostInfo struct {
ID string `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
Content string `json:"content"`
Excerpt string `json:"excerpt,omitempty"`
Status string `json:"status"`
MetaTitle string `json:"meta_title,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
FeaturedImage string `json:"featured_image,omitempty"`
CategoryName string `json:"category_name,omitempty"`
CategorySlug string `json:"category_slug,omitempty"`
AuthorID string `json:"author_id,omitempty"`
CreatedAt string `json:"created_at"`
PublishedAt string `json:"published_at,omitempty"`
}
SDKContentPostInfo represents the SDKContentPostInfo type.
type SDKCustomerInfo ¶
type SDKCustomerInfo struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Phone string `json:"phone,omitempty"`
StripeCustomerID string `json:"stripe_customer_id,omitempty"`
Status string `json:"status"`
TotalSpent int64 `json:"total_spent"`
OrderCount int `json:"order_count"`
SubscriptionCount int `json:"subscription_count"`
CreatedAt string `json:"created_at"`
}
SDKCustomerInfo represents the SDKCustomerInfo type.
type SDKForgotPasswordRequest ¶
type SDKForgotPasswordRequest struct {
Email string `json:"email"`
ResetPath string `json:"reset_path,omitempty"`
}
SDKForgotPasswordRequest represents the SDKForgotPasswordRequest type.
type SDKInviteTeamMemberRequest ¶
SDKInviteTeamMemberRequest represents the SDKInviteTeamMemberRequest type.
type SDKInvoiceInfo ¶
type SDKInvoiceInfo struct {
ID string `json:"id"`
StripeInvoiceID string `json:"stripe_invoice_id,omitempty"`
Number string `json:"number"`
Status string `json:"status"`
AmountDue int64 `json:"amount_due"`
AmountPaid int64 `json:"amount_paid"`
Currency string `json:"currency"`
Description string `json:"description,omitempty"`
InvoicePdfUrl string `json:"invoice_pdf_url,omitempty"`
HostedUrl string `json:"hosted_url,omitempty"`
DueDate string `json:"due_date,omitempty"`
PaidAt string `json:"paid_at,omitempty"`
CreatedAt string `json:"created_at"`
}
SDKInvoiceInfo represents the SDKInvoiceInfo type.
type SDKLoginRequest ¶
SDKLoginRequest represents the SDKLoginRequest type.
type SDKNavigationItem ¶
type SDKNavigationItem struct {
}
SDKNavigationItem represents the SDKNavigationItem type.
type SDKNavigationMenu ¶
type SDKNavigationMenu struct {
}
SDKNavigationMenu represents the SDKNavigationMenu type.
type SDKOrderInfo ¶
type SDKOrderInfo struct {
ID string `json:"id"`
OrderNumber string `json:"order_number"`
Status string `json:"status"`
TotalCents int64 `json:"total_cents"`
Currency string `json:"currency"`
Items []SDKOrderItem `json:"items"`
PaymentMethod string `json:"payment_method,omitempty"`
PaidAt string `json:"paid_at,omitempty"`
FulfilledAt string `json:"fulfilled_at,omitempty"`
CreatedAt string `json:"created_at"`
}
SDKOrderInfo represents the SDKOrderInfo type.
type SDKOrderItem ¶
type SDKOrderItem struct {
ProductName string `json:"product_name"`
Quantity int `json:"quantity"`
UnitPrice int64 `json:"unit_price"`
TotalPrice int64 `json:"total_price"`
}
SDKOrderItem represents the SDKOrderItem type.
type SDKPaymentInfo ¶
type SDKPaymentInfo struct {
ID string `json:"id"`
StripePaymentID string `json:"stripe_payment_id,omitempty"`
AmountCents int64 `json:"amount_cents"`
Currency string `json:"currency"`
Status string `json:"status"`
Description string `json:"description,omitempty"`
PaymentMethod string `json:"payment_method,omitempty"`
ReceiptUrl string `json:"receipt_url,omitempty"`
RefundedAt string `json:"refunded_at,omitempty"`
CreatedAt string `json:"created_at"`
}
SDKPaymentInfo represents the SDKPaymentInfo type.
type SDKRefreshTokenRequest ¶
type SDKRefreshTokenRequest struct {
RefreshToken string `json:"refresh_token"`
}
SDKRefreshTokenRequest represents the SDKRefreshTokenRequest type.
type SDKRegisterRequest ¶
type SDKRegisterRequest struct {
Email string `json:"email"`
Password string `json:"password"`
Name string `json:"name,omitempty"`
PriceNickname string `json:"price_nickname,omitempty"`
SuccessUrl string `json:"success_url,omitempty"`
CancelUrl string `json:"cancel_url,omitempty"`
}
SDKRegisterRequest represents the SDKRegisterRequest type.
type SDKResetPasswordRequest ¶
type SDKResetPasswordRequest struct {
Token string `json:"token"`
Password string `json:"password"`
ConfirmPassword string `json:"confirm_password"`
}
SDKResetPasswordRequest represents the SDKResetPasswordRequest type.
type SDKSiteSettings ¶
type SDKSiteSettings struct {
SiteName string `json:"site_name,omitempty"`
Tagline string `json:"tagline,omitempty"`
LogoUrl string `json:"logo_url,omitempty"`
FaviconUrl string `json:"favicon_url,omitempty"`
ContactEmail string `json:"contact_email,omitempty"`
ContactPhone string `json:"contact_phone,omitempty"`
ContactAddress string `json:"contact_address,omitempty"`
SocialLinks map[string]string `json:"social_links,omitempty"`
MetaTitleTemplate string `json:"meta_title_template,omitempty"`
MetaDescription string `json:"meta_description,omitempty"`
OgImageUrl string `json:"og_image_url,omitempty"`
}
SDKSiteSettings represents the SDKSiteSettings type.
type SDKSubscriptionInfo ¶
type SDKSubscriptionInfo struct {
ID string `json:"id"`
StripeSubscriptionID string `json:"stripe_subscription_id,omitempty"`
ProductName string `json:"product_name"`
PriceName string `json:"price_name,omitempty"`
Status string `json:"status"`
AmountCents int64 `json:"amount_cents"`
Currency string `json:"currency"`
Interval string `json:"interval"`
CurrentPeriodStart string `json:"current_period_start"`
CurrentPeriodEnd string `json:"current_period_end"`
CancelAtPeriodEnd bool `json:"cancel_at_period_end"`
TrialEnd string `json:"trial_end,omitempty"`
CreatedAt string `json:"created_at"`
}
SDKSubscriptionInfo represents the SDKSubscriptionInfo type.
type SDKUpdateCustomerRequest ¶
type SDKUpdateCustomerRequest struct {
Name string `json:"name,omitempty"`
Phone string `json:"phone,omitempty"`
AvatarUrl string `json:"avatar_url,omitempty"`
Status string `json:"status,omitempty"`
Metadata string `json:"metadata,omitempty"`
}
SDKUpdateCustomerRequest represents the SDKUpdateCustomerRequest type.
type SDKUpdateTeamMemberRoleRequest ¶
type SDKUpdateTeamMemberRoleRequest struct {
NewRole string `json:"new_role"`
}
SDKUpdateTeamMemberRoleRequest represents the SDKUpdateTeamMemberRoleRequest type.
type SDKVerifyEmailRequest ¶
type SDKVerifyEmailRequest struct {
Token string `json:"token"`
}
SDKVerifyEmailRequest represents the SDKVerifyEmailRequest type.
type SendEmailRequest ¶
type SendEmailRequest struct {
To string `json:"to"`
TemplateSlug string `json:"template_slug,omitempty"`
Subject string `json:"subject,omitempty"`
Body string `json:"body,omitempty"`
TextBody string `json:"text_body,omitempty"`
FromName string `json:"from_name,omitempty"`
FromEmail string `json:"from_email,omitempty"`
ReplyTo string `json:"reply_to,omitempty"`
Variables map[string]string `json:"variables,omitempty"`
Tags []string `json:"tags,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
}
SendEmailRequest represents the SendEmailRequest type.
type SendEmailResponse ¶
type SendEmailResponse struct {
Success bool `json:"success"`
MessageID string `json:"message_id"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
}
SendEmailResponse represents the SendEmailResponse type.
type SequenceEnrollmentInfo ¶
type SequenceEnrollmentInfo struct {
EnrollmentID string `json:"enrollment_id"`
SequenceSlug string `json:"sequence_slug"`
SequenceName string `json:"sequence_name"`
Status string `json:"status"`
CurrentStep int `json:"current_step"`
TotalSteps int `json:"total_steps"`
EnrolledAt string `json:"enrolled_at"`
NextEmailAt string `json:"next_email_at,omitempty"`
CompletedAt string `json:"completed_at,omitempty"`
EmailsSent int `json:"emails_sent"`
EmailsOpened int `json:"emails_opened"`
EmailsClicked int `json:"emails_clicked"`
}
SequenceEnrollmentInfo represents the SequenceEnrollmentInfo type.
type SequencesResource ¶
type SequencesResource struct {
// contains filtered or unexported fields
}
SequencesResource provides access to sequences resources.
func (*SequencesResource) EnrollInSequence ¶
func (r *SequencesResource) EnrollInSequence(ctx context.Context, request *EnrollSequenceRequest) (*EnrollSequenceResponse, error)
EnrollInSequence
func (*SequencesResource) GetSequenceEnrollments ¶
func (r *SequencesResource) GetSequenceEnrollments(ctx context.Context, email string, sequenceSlug string) (*ListSequenceEnrollmentsResponse, error)
GetSequenceEnrollments
func (*SequencesResource) PauseSequenceEnrollment ¶
func (r *SequencesResource) PauseSequenceEnrollment(ctx context.Context, request *PauseSequenceRequest) (*Response, error)
PauseSequenceEnrollment
func (*SequencesResource) ResumeSequenceEnrollment ¶
func (r *SequencesResource) ResumeSequenceEnrollment(ctx context.Context, request *ResumeSequenceRequest) (*Response, error)
ResumeSequenceEnrollment
func (*SequencesResource) UnenrollFromSequence ¶
func (r *SequencesResource) UnenrollFromSequence(ctx context.Context, request *UnenrollSequenceRequest) (*Response, error)
UnenrollFromSequence
type SiteResource ¶
type SiteResource struct {
// contains filtered or unexported fields
}
SiteResource provides access to site resources.
func (*SiteResource) GetAuthor ¶
func (r *SiteResource) GetAuthor(ctx context.Context, id string) (*SDKAuthorInfo, error)
GetAuthor
func (*SiteResource) GetNavigationMenu ¶
func (r *SiteResource) GetNavigationMenu(ctx context.Context, slug string) (*SDKNavigationMenu, error)
GetNavigationMenu
func (*SiteResource) GetSiteSettings ¶
func (r *SiteResource) GetSiteSettings(ctx context.Context) (*SDKSiteSettings, error)
GetSiteSettings
func (*SiteResource) ListAuthors ¶
func (r *SiteResource) ListAuthors(ctx context.Context) (*ListSDKAuthorsResponse, error)
ListAuthors
func (*SiteResource) ListNavigationMenus ¶
func (r *SiteResource) ListNavigationMenus(ctx context.Context, location string) (*ListSDKNavigationMenusResponse, error)
ListNavigationMenus
type StatsOverviewResponse ¶
type StatsOverviewResponse struct {
TotalContacts int `json:"total_contacts"`
NewContacts int `json:"new_contacts"`
ActiveContacts int `json:"active_contacts"`
EmailsSent int `json:"emails_sent"`
EmailsDelivered int `json:"emails_delivered"`
EmailsOpened int `json:"emails_opened"`
EmailsClicked int `json:"emails_clicked"`
EmailsBounced int `json:"emails_bounced"`
OpenRate float64 `json:"open_rate"`
ClickRate float64 `json:"click_rate"`
BounceRate float64 `json:"bounce_rate"`
TotalRevenue int64 `json:"total_revenue"`
OrderCount int `json:"order_count"`
AvgOrderValue int64 `json:"avg_order_value"`
NewSubscriptions int `json:"new_subscriptions"`
}
StatsOverviewResponse represents the StatsOverviewResponse type.
type StatsResource ¶
type StatsResource struct {
// contains filtered or unexported fields
}
StatsResource provides access to stats resources.
func (*StatsResource) GetContactStats ¶
func (r *StatsResource) GetContactStats(ctx context.Context, startDate string, endDate string, groupBy string) (*GetContactStatsResponse, error)
GetContactStats
func (*StatsResource) GetEmailStats ¶
func (r *StatsResource) GetEmailStats(ctx context.Context, startDate string, endDate string, groupBy string) (*GetEmailStatsResponse, error)
GetEmailStats
func (*StatsResource) GetRevenueStats ¶
func (r *StatsResource) GetRevenueStats(ctx context.Context, startDate string, endDate string, groupBy string) (*GetRevenueStatsResponse, error)
GetRevenueStats
func (*StatsResource) GetStatsOverview ¶
func (r *StatsResource) GetStatsOverview(ctx context.Context, startDate string, endDate string) (*StatsOverviewResponse, error)
GetStatsOverview
type StreamCallback ¶
type StreamCallback func(chunk StreamChunk) error
StreamCallback is called for each chunk during streaming.
type StreamChunk ¶
StreamChunk represents a chunk of streamed content.
type SubscribeRequest ¶
SubscribeRequest represents the SubscribeRequest type.
type SubscriptionRequest ¶
type SubscriptionRequest struct {
CustomerID string `json:"customer_id"`
PriceIds []string `json:"price_ids"`
}
SubscriptionRequest represents the SubscriptionRequest type.
type SubscriptionResponse ¶
type SubscriptionResponse struct {
ID string `json:"id"`
StripeSubscriptionID string `json:"stripe_subscription_id"`
Status string `json:"status"`
}
SubscriptionResponse represents the SubscriptionResponse type.
type TeamResource ¶
type TeamResource struct {
// contains filtered or unexported fields
}
TeamResource provides access to team resources.
func (*TeamResource) AcceptInvite ¶
func (r *TeamResource) AcceptInvite(ctx context.Context, request *AcceptInviteRequest) (*AcceptInviteResponse, error)
AcceptInvite
func (*TeamResource) InviteTeamMember ¶
func (r *TeamResource) InviteTeamMember(ctx context.Context, request *SDKInviteTeamMemberRequest) (*Response, error)
InviteTeamMember
func (*TeamResource) ListTeamMembers ¶
func (r *TeamResource) ListTeamMembers(ctx context.Context) (*OrgMembersResponse, error)
ListTeamMembers
func (*TeamResource) RemoveTeamMember ¶
RemoveTeamMember
func (*TeamResource) UpdateTeamMemberRole ¶
func (r *TeamResource) UpdateTeamMemberRole(ctx context.Context, id string, request *SDKUpdateTeamMemberRoleRequest) (*Response, error)
UpdateTeamMemberRole
func (*TeamResource) ValidateInvite ¶
func (r *TeamResource) ValidateInvite(ctx context.Context, token string) (*ValidateInviteTokenResponse, error)
ValidateInvite
type TestWebhookResponse ¶
type TestWebhookResponse struct {
Success bool `json:"success"`
StatusCode int `json:"status_code"`
Response string `json:"response,omitempty"`
Error string `json:"error,omitempty"`
}
TestWebhookResponse represents the TestWebhookResponse type.
type TrackClickRequest ¶
TrackClickRequest represents the TrackClickRequest type.
type TrackConfirmRequest ¶
type TrackConfirmRequest struct {
Token string `json:"token"`
}
TrackConfirmRequest represents the TrackConfirmRequest type.
type TrackConfirmResponse ¶
type TrackConfirmResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
RedirectUrl string `json:"redirect_url,omitempty"`
}
TrackConfirmResponse represents the TrackConfirmResponse type.
type TrackOpenRequest ¶
type TrackOpenRequest struct {
Token string `json:"token"`
}
TrackOpenRequest represents the TrackOpenRequest type.
type TrackUnsubscribeRequest ¶
type TrackUnsubscribeRequest struct {
Token string `json:"token"`
}
TrackUnsubscribeRequest represents the TrackUnsubscribeRequest type.
type TrackingResource ¶
type TrackingResource struct {
// contains filtered or unexported fields
}
TrackingResource provides access to tracking resources.
func (*TrackingResource) TrackClick ¶
func (r *TrackingResource) TrackClick(ctx context.Context, request *TrackClickRequest) (*Response, error)
TrackClick
func (*TrackingResource) TrackConfirm ¶
func (r *TrackingResource) TrackConfirm(ctx context.Context, request *TrackConfirmRequest) (*TrackConfirmResponse, error)
TrackConfirm
func (*TrackingResource) TrackOpen ¶
func (r *TrackingResource) TrackOpen(ctx context.Context, request *TrackOpenRequest) (*Response, error)
TrackOpen
func (*TrackingResource) TrackUnsubscribe ¶
func (r *TrackingResource) TrackUnsubscribe(ctx context.Context, request *TrackUnsubscribeRequest) (*Response, error)
TrackUnsubscribe
type UnenrollSequenceRequest ¶
type UnenrollSequenceRequest struct {
Email string `json:"email"`
SequenceSlug string `json:"sequence_slug,omitempty"`
}
UnenrollSequenceRequest represents the UnenrollSequenceRequest type.
type UpdateContactRequest ¶
type UpdateContactRequest struct {
Name string `json:"name,omitempty"`
Phone string `json:"phone,omitempty"`
Company string `json:"company,omitempty"`
CustomFields map[string]string `json:"custom_fields,omitempty"`
}
UpdateContactRequest represents the UpdateContactRequest type.
type UpdateWebhookRequest ¶
type UpdateWebhookRequest struct {
Url string `json:"url,omitempty"`
Events []string `json:"events,omitempty"`
Active bool `json:"active,omitempty"`
}
UpdateWebhookRequest represents the UpdateWebhookRequest type.
type UsageRequest ¶
type UsageRequest struct {
SubscriptionItemID string `json:"subscription_item_id"`
Quantity int `json:"quantity"`
}
UsageRequest represents the UsageRequest type.
type ValidateInviteTokenResponse ¶
type ValidateInviteTokenResponse struct {
Valid bool `json:"valid"`
OrgName string `json:"org_name,omitempty"`
InviterName string `json:"inviter_name,omitempty"`
Email string `json:"email,omitempty"`
Role string `json:"role,omitempty"`
Message string `json:"message,omitempty"`
}
ValidateInviteTokenResponse represents the ValidateInviteTokenResponse type.
type WSAbortRequest ¶
type WSAbortRequest struct {
Reason string `json:"reason,omitempty"`
}
WSAbortRequest aborts the current generation.
type WSChunkResponse ¶
WSChunkResponse streams content chunks.
type WSCompletionResponse ¶
type WSCompletionResponse struct {
FullContent string `json:"full_content"`
StopReason string `json:"stop_reason"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CostUSD float64 `json:"cost_usd"`
LatencyMs int64 `json:"latency_ms"`
}
WSCompletionResponse indicates generation complete.
type WSConfig ¶
type WSConfig struct {
// CheckOrigin is called to check the origin of the WebSocket request.
// If nil, allows all origins.
CheckOrigin func(r *http.Request) bool
}
WSConfig configures the WebSocket handler.
type WSErrorResponse ¶
type WSErrorResponse struct {
Code string `json:"code"`
Message string `json:"message"`
Retryable bool `json:"retryable"`
}
WSErrorResponse indicates an error.
type WSMessage ¶
type WSMessage struct {
Type string `json:"type"`
Data json.RawMessage `json:"data,omitempty"`
}
WSMessage is the base WebSocket message envelope.
type WSOption ¶
type WSOption func(*WSConfig)
WSOption is a functional option for configuring the WebSocket handler.
type WSStartRequest ¶
type WSStartRequest struct {
SystemPrompt string `json:"system_prompt,omitempty"`
Model string `json:"model,omitempty"` // "haiku", "sonnet", "opus"
MaxTokens int32 `json:"max_tokens,omitempty"`
Temperature float32 `json:"temperature,omitempty"`
Messages []ChatMessage `json:"messages,omitempty"`
}
WSStartRequest starts a new chat session.
type WSStartedResponse ¶
type WSStartedResponse struct {
SessionID string `json:"session_id"`
Provider string `json:"provider"`
Model string `json:"model"`
}
WSStartedResponse confirms session started.
type WSToolCallResponse ¶
type WSToolCallResponse struct {
ToolCallID string `json:"tool_call_id"`
Name string `json:"name"`
ArgumentsJSON string `json:"arguments_json"`
}
WSToolCallResponse indicates LLM wants to call a tool.
type WSToolResult ¶
type WSToolResult struct {
ToolCallID string `json:"tool_call_id"`
Result string `json:"result"`
IsError bool `json:"is_error,omitempty"`
}
WSToolResult provides a tool call result.
type WSUserMessage ¶
type WSUserMessage struct {
Content string `json:"content"`
}
WSUserMessage sends a user message.
type WebhookInfo ¶
type WebhookInfo struct {
ID string `json:"id"`
Url string `json:"url"`
Events []string `json:"events"`
Active bool `json:"active"`
CreatedAt string `json:"created_at"`
DeliveriesTotal int `json:"deliveries_total"`
DeliveriesSuccess int `json:"deliveries_success"`
DeliveriesFailed int `json:"deliveries_failed"`
LastDeliveryAt string `json:"last_delivery_at,omitempty"`
LastStatus int `json:"last_status,omitempty"`
}
WebhookInfo represents the WebhookInfo type.
type WebhookLogInfo ¶
type WebhookLogInfo struct {
ID string `json:"id"`
Event string `json:"event"`
Payload string `json:"payload"`
StatusCode int `json:"status_code"`
Response string `json:"response,omitempty"`
Error string `json:"error,omitempty"`
Duration int `json:"duration_ms"`
DeliveredAt string `json:"delivered_at"`
}
WebhookLogInfo represents the WebhookLogInfo type.
type WebhooksResource ¶
type WebhooksResource struct {
// contains filtered or unexported fields
}
WebhooksResource provides access to webhooks resources.
func (*WebhooksResource) DeleteWebhook ¶
DeleteWebhook
func (*WebhooksResource) GetWebhook ¶
func (r *WebhooksResource) GetWebhook(ctx context.Context, id string) (*WebhookInfo, error)
GetWebhook
func (*WebhooksResource) ListWebhookLogs ¶
func (r *WebhooksResource) ListWebhookLogs(ctx context.Context, id string, limit int) (*ListWebhookLogsResponse, error)
ListWebhookLogs
func (*WebhooksResource) ListWebhooks ¶
func (r *WebhooksResource) ListWebhooks(ctx context.Context) (*ListWebhooksResponse, error)
ListWebhooks
func (*WebhooksResource) RegisterWebhook ¶
func (r *WebhooksResource) RegisterWebhook(ctx context.Context, request *RegisterWebhookRequest) (*RegisterWebhookResponse, error)
RegisterWebhook
func (*WebhooksResource) TestWebhook ¶
func (r *WebhooksResource) TestWebhook(ctx context.Context, id string) (*TestWebhookResponse, error)
TestWebhook
func (*WebhooksResource) UpdateWebhook ¶
func (r *WebhooksResource) UpdateWebhook(ctx context.Context, id string, request *UpdateWebhookRequest) (*WebhookInfo, error)
UpdateWebhook
type WorkshopAgendaDay ¶
type WorkshopAgendaDay struct {
Day string `json:"day"`
Title string `json:"title"`
Items []string `json:"items"`
}
WorkshopAgendaDay represents the WorkshopAgendaDay type.
type WorkshopEventInfo ¶
type WorkshopEventInfo struct {
ID int64 `json:"id"`
Slug string `json:"slug"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
Timezone string `json:"timezone"`
LocationType string `json:"location_type"`
LocationDetails string `json:"location_details,omitempty"`
PriceCents int `json:"price_cents"`
Currency string `json:"currency"`
MaxSeats int `json:"max_seats"`
SeatsRemaining int `json:"seats_remaining"`
Status string `json:"status"`
WhatsIncluded []string `json:"whats_included"`
WhoItsFor []string `json:"who_its_for"`
Agenda []WorkshopAgendaDay `json:"agenda"`
ProductID string `json:"product_id,omitempty"`
ProductSlug string `json:"product_slug,omitempty"`
ProductName string `json:"product_name,omitempty"`
AllowWaitlist bool `json:"allow_waitlist"`
WaitlistLimit int `json:"waitlist_limit,omitempty"`
WaitlistCount int `json:"waitlist_count,omitempty"`
FunnelID int64 `json:"funnel_id,omitempty"`
FunnelSlug string `json:"funnel_slug,omitempty"`
ConfirmationSequenceID int64 `json:"confirmation_sequence_id,omitempty"`
ReminderSequenceID int64 `json:"reminder_sequence_id,omitempty"`
OrderBumpProductIds []string `json:"order_bump_product_ids,omitempty"`
}
WorkshopEventInfo represents the WorkshopEventInfo type.
type WorkshopsResource ¶
type WorkshopsResource struct {
// contains filtered or unexported fields
}
WorkshopsResource provides access to workshops resources.
func (*WorkshopsResource) GetWorkshop ¶
func (r *WorkshopsResource) GetWorkshop(ctx context.Context, slug string) (*WorkshopEventInfo, error)
GetWorkshop
func (*WorkshopsResource) GetWorkshopByProduct ¶
func (r *WorkshopsResource) GetWorkshopByProduct(ctx context.Context, productSlug string) (*WorkshopEventInfo, error)
GetWorkshopByProduct