@stackbe/sdk 0.15.1 → 0.15.3
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/index.d.mts +52 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +32 -0
- package/dist/index.mjs +32 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2398,6 +2398,23 @@ interface TrackReferralResponse {
|
|
|
2398
2398
|
token: string;
|
|
2399
2399
|
expiresInDays: number;
|
|
2400
2400
|
}
|
|
2401
|
+
interface PartnerApplicationOptions {
|
|
2402
|
+
/** Applicant email address */
|
|
2403
|
+
email: string;
|
|
2404
|
+
/** Applicant name */
|
|
2405
|
+
name: string;
|
|
2406
|
+
/** Company or business name */
|
|
2407
|
+
company?: string;
|
|
2408
|
+
/** Website URL */
|
|
2409
|
+
website?: string;
|
|
2410
|
+
/** Why they want to become a partner */
|
|
2411
|
+
reason?: string;
|
|
2412
|
+
}
|
|
2413
|
+
interface PartnerApplicationResponse {
|
|
2414
|
+
id: string;
|
|
2415
|
+
status: 'pending';
|
|
2416
|
+
message: string;
|
|
2417
|
+
}
|
|
2401
2418
|
interface EnrollOptions {
|
|
2402
2419
|
/** Preferred referral code (auto-generated if not provided) */
|
|
2403
2420
|
code?: string;
|
|
@@ -2418,6 +2435,12 @@ interface DealListResponse {
|
|
|
2418
2435
|
deals: DealRegistration[];
|
|
2419
2436
|
total: number;
|
|
2420
2437
|
}
|
|
2438
|
+
interface PortalLinkResponse {
|
|
2439
|
+
/** URL to the hosted partner portal page */
|
|
2440
|
+
url: string;
|
|
2441
|
+
/** Token expiration time (e.g. "24h") */
|
|
2442
|
+
expiresIn: string;
|
|
2443
|
+
}
|
|
2421
2444
|
declare class AffiliatesClient {
|
|
2422
2445
|
private http;
|
|
2423
2446
|
constructor(http: HttpClient);
|
|
@@ -2447,11 +2470,39 @@ declare class AffiliatesClient {
|
|
|
2447
2470
|
* Requires customer session token.
|
|
2448
2471
|
*/
|
|
2449
2472
|
getCommissions(): Promise<AffiliateCommissionsResponse>;
|
|
2473
|
+
/**
|
|
2474
|
+
* Apply to become a partner. No account required — just an API key.
|
|
2475
|
+
* The application will be reviewed by the app admin.
|
|
2476
|
+
*
|
|
2477
|
+
* @example
|
|
2478
|
+
* ```typescript
|
|
2479
|
+
* const result = await stackbe.affiliates.apply({
|
|
2480
|
+
* email: 'partner@example.com',
|
|
2481
|
+
* name: 'Jane Smith',
|
|
2482
|
+
* company: 'Acme Inc',
|
|
2483
|
+
* website: 'https://acme.com',
|
|
2484
|
+
* reason: 'I have a large audience in the SaaS space',
|
|
2485
|
+
* });
|
|
2486
|
+
* console.log(result.status); // 'pending'
|
|
2487
|
+
* ```
|
|
2488
|
+
*/
|
|
2489
|
+
apply(options: PartnerApplicationOptions): Promise<PartnerApplicationResponse>;
|
|
2450
2490
|
/**
|
|
2451
2491
|
* Track a referral click (store token for attribution).
|
|
2452
2492
|
* Requires API key.
|
|
2453
2493
|
*/
|
|
2454
2494
|
trackReferral(code: string, referralUrl?: string): Promise<TrackReferralResponse>;
|
|
2495
|
+
/**
|
|
2496
|
+
* Get a link to the hosted partner portal (valid 24 hours).
|
|
2497
|
+
* Requires customer session token and active partner enrollment.
|
|
2498
|
+
*
|
|
2499
|
+
* @example
|
|
2500
|
+
* ```typescript
|
|
2501
|
+
* const { url } = await stackbe.affiliates.getPortalLink();
|
|
2502
|
+
* // Redirect partner to `url` or display in UI
|
|
2503
|
+
* ```
|
|
2504
|
+
*/
|
|
2505
|
+
getPortalLink(): Promise<PortalLinkResponse>;
|
|
2455
2506
|
/**
|
|
2456
2507
|
* Get the full partner dashboard with stats, earnings by source, deals, and coupons.
|
|
2457
2508
|
* Requires customer session token.
|
|
@@ -3066,4 +3117,4 @@ declare class StackBE {
|
|
|
3066
3117
|
}): (req: any, res: any, next: any) => Promise<any>;
|
|
3067
3118
|
}
|
|
3068
3119
|
|
|
3069
|
-
export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, AnalyticsClient, type AnalyticsFilterOptions, type AnyWebhookEvent, type AttachPaymentMethodOptions, AuthClient, type BillingPortalSession, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type ChargeResult, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type Coupon, type CouponDiscountType, type CouponDuration, CouponsClient, type CreateCheckoutOptions, type CreateCouponOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type CreateSetupSessionOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerInvoice, type CustomerInvoicesResponse, type CustomerPaymentMethod, type CustomerSubscriptionHistory, type CustomerSubscriptionHistoryResponse, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, type DashboardMetrics, type DunningStatus, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestImage, type FeatureRequestListResponse, FeatureRequestsClient, type FeatureUsagePoint, type GetSubscriptionOptions, type GrowthChartPoint, type GrowthMetrics, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MRRHistoryPoint, type MagicLinkOptions, type MagicLinkResponse, type MigrateToStackbeManagedResult, type Organization, type OrganizationInvite, type OrganizationMember, type OrganizationMembership, OrganizationsClient, type PaymentFailedEvent, type PaymentMethod, PaymentMethodsClient, type PaymentSucceededEvent, type PaymentWebhookPayload, type PerformanceMetrics, type Plan, type PlanMetrics, PlansClient, type PopularEndpoint, type Product, ProductsClient, type RequestCountPoint, type RevenueByPlan, type SessionResponse, type SetupSessionResponse, StackBE, type StackBEConfig, StackBEError, type StackBEErrorCode, type StackBEErrorResponse, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionPlan, type SubscriptionRenewedEvent, type SubscriptionUpdatedEvent, type SubscriptionWebhookPayload, type SubscriptionWithPlan, SubscriptionsClient, type SwitchOrganizationResponse, type TimeRangeOptions, type TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialMetrics, type TrialStartedEvent, type TrialStatus, type UpcomingInvoice, type UpdateCouponOptions, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type ValidateCouponResult, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
|
|
3120
|
+
export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, AnalyticsClient, type AnalyticsFilterOptions, type AnyWebhookEvent, type AttachPaymentMethodOptions, AuthClient, type BillingPortalSession, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type ChargeResult, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type Coupon, type CouponDiscountType, type CouponDuration, CouponsClient, type CreateCheckoutOptions, type CreateCouponOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type CreateSetupSessionOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerInvoice, type CustomerInvoicesResponse, type CustomerPaymentMethod, type CustomerSubscriptionHistory, type CustomerSubscriptionHistoryResponse, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, type DashboardMetrics, type DunningStatus, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestImage, type FeatureRequestListResponse, FeatureRequestsClient, type FeatureUsagePoint, type GetSubscriptionOptions, type GrowthChartPoint, type GrowthMetrics, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MRRHistoryPoint, type MagicLinkOptions, type MagicLinkResponse, type MigrateToStackbeManagedResult, type Organization, type OrganizationInvite, type OrganizationMember, type OrganizationMembership, OrganizationsClient, type PaymentFailedEvent, type PaymentMethod, PaymentMethodsClient, type PaymentSucceededEvent, type PaymentWebhookPayload, type PerformanceMetrics, type Plan, type PlanMetrics, PlansClient, type PopularEndpoint, type PortalLinkResponse, type Product, ProductsClient, type RequestCountPoint, type RevenueByPlan, type SessionResponse, type SetupSessionResponse, StackBE, type StackBEConfig, StackBEError, type StackBEErrorCode, type StackBEErrorResponse, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionPlan, type SubscriptionRenewedEvent, type SubscriptionUpdatedEvent, type SubscriptionWebhookPayload, type SubscriptionWithPlan, SubscriptionsClient, type SwitchOrganizationResponse, type TimeRangeOptions, type TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialMetrics, type TrialStartedEvent, type TrialStatus, type UpcomingInvoice, type UpdateCouponOptions, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type ValidateCouponResult, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
|
package/dist/index.d.ts
CHANGED
|
@@ -2398,6 +2398,23 @@ interface TrackReferralResponse {
|
|
|
2398
2398
|
token: string;
|
|
2399
2399
|
expiresInDays: number;
|
|
2400
2400
|
}
|
|
2401
|
+
interface PartnerApplicationOptions {
|
|
2402
|
+
/** Applicant email address */
|
|
2403
|
+
email: string;
|
|
2404
|
+
/** Applicant name */
|
|
2405
|
+
name: string;
|
|
2406
|
+
/** Company or business name */
|
|
2407
|
+
company?: string;
|
|
2408
|
+
/** Website URL */
|
|
2409
|
+
website?: string;
|
|
2410
|
+
/** Why they want to become a partner */
|
|
2411
|
+
reason?: string;
|
|
2412
|
+
}
|
|
2413
|
+
interface PartnerApplicationResponse {
|
|
2414
|
+
id: string;
|
|
2415
|
+
status: 'pending';
|
|
2416
|
+
message: string;
|
|
2417
|
+
}
|
|
2401
2418
|
interface EnrollOptions {
|
|
2402
2419
|
/** Preferred referral code (auto-generated if not provided) */
|
|
2403
2420
|
code?: string;
|
|
@@ -2418,6 +2435,12 @@ interface DealListResponse {
|
|
|
2418
2435
|
deals: DealRegistration[];
|
|
2419
2436
|
total: number;
|
|
2420
2437
|
}
|
|
2438
|
+
interface PortalLinkResponse {
|
|
2439
|
+
/** URL to the hosted partner portal page */
|
|
2440
|
+
url: string;
|
|
2441
|
+
/** Token expiration time (e.g. "24h") */
|
|
2442
|
+
expiresIn: string;
|
|
2443
|
+
}
|
|
2421
2444
|
declare class AffiliatesClient {
|
|
2422
2445
|
private http;
|
|
2423
2446
|
constructor(http: HttpClient);
|
|
@@ -2447,11 +2470,39 @@ declare class AffiliatesClient {
|
|
|
2447
2470
|
* Requires customer session token.
|
|
2448
2471
|
*/
|
|
2449
2472
|
getCommissions(): Promise<AffiliateCommissionsResponse>;
|
|
2473
|
+
/**
|
|
2474
|
+
* Apply to become a partner. No account required — just an API key.
|
|
2475
|
+
* The application will be reviewed by the app admin.
|
|
2476
|
+
*
|
|
2477
|
+
* @example
|
|
2478
|
+
* ```typescript
|
|
2479
|
+
* const result = await stackbe.affiliates.apply({
|
|
2480
|
+
* email: 'partner@example.com',
|
|
2481
|
+
* name: 'Jane Smith',
|
|
2482
|
+
* company: 'Acme Inc',
|
|
2483
|
+
* website: 'https://acme.com',
|
|
2484
|
+
* reason: 'I have a large audience in the SaaS space',
|
|
2485
|
+
* });
|
|
2486
|
+
* console.log(result.status); // 'pending'
|
|
2487
|
+
* ```
|
|
2488
|
+
*/
|
|
2489
|
+
apply(options: PartnerApplicationOptions): Promise<PartnerApplicationResponse>;
|
|
2450
2490
|
/**
|
|
2451
2491
|
* Track a referral click (store token for attribution).
|
|
2452
2492
|
* Requires API key.
|
|
2453
2493
|
*/
|
|
2454
2494
|
trackReferral(code: string, referralUrl?: string): Promise<TrackReferralResponse>;
|
|
2495
|
+
/**
|
|
2496
|
+
* Get a link to the hosted partner portal (valid 24 hours).
|
|
2497
|
+
* Requires customer session token and active partner enrollment.
|
|
2498
|
+
*
|
|
2499
|
+
* @example
|
|
2500
|
+
* ```typescript
|
|
2501
|
+
* const { url } = await stackbe.affiliates.getPortalLink();
|
|
2502
|
+
* // Redirect partner to `url` or display in UI
|
|
2503
|
+
* ```
|
|
2504
|
+
*/
|
|
2505
|
+
getPortalLink(): Promise<PortalLinkResponse>;
|
|
2455
2506
|
/**
|
|
2456
2507
|
* Get the full partner dashboard with stats, earnings by source, deals, and coupons.
|
|
2457
2508
|
* Requires customer session token.
|
|
@@ -3066,4 +3117,4 @@ declare class StackBE {
|
|
|
3066
3117
|
}): (req: any, res: any, next: any) => Promise<any>;
|
|
3067
3118
|
}
|
|
3068
3119
|
|
|
3069
|
-
export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, AnalyticsClient, type AnalyticsFilterOptions, type AnyWebhookEvent, type AttachPaymentMethodOptions, AuthClient, type BillingPortalSession, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type ChargeResult, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type Coupon, type CouponDiscountType, type CouponDuration, CouponsClient, type CreateCheckoutOptions, type CreateCouponOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type CreateSetupSessionOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerInvoice, type CustomerInvoicesResponse, type CustomerPaymentMethod, type CustomerSubscriptionHistory, type CustomerSubscriptionHistoryResponse, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, type DashboardMetrics, type DunningStatus, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestImage, type FeatureRequestListResponse, FeatureRequestsClient, type FeatureUsagePoint, type GetSubscriptionOptions, type GrowthChartPoint, type GrowthMetrics, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MRRHistoryPoint, type MagicLinkOptions, type MagicLinkResponse, type MigrateToStackbeManagedResult, type Organization, type OrganizationInvite, type OrganizationMember, type OrganizationMembership, OrganizationsClient, type PaymentFailedEvent, type PaymentMethod, PaymentMethodsClient, type PaymentSucceededEvent, type PaymentWebhookPayload, type PerformanceMetrics, type Plan, type PlanMetrics, PlansClient, type PopularEndpoint, type Product, ProductsClient, type RequestCountPoint, type RevenueByPlan, type SessionResponse, type SetupSessionResponse, StackBE, type StackBEConfig, StackBEError, type StackBEErrorCode, type StackBEErrorResponse, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionPlan, type SubscriptionRenewedEvent, type SubscriptionUpdatedEvent, type SubscriptionWebhookPayload, type SubscriptionWithPlan, SubscriptionsClient, type SwitchOrganizationResponse, type TimeRangeOptions, type TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialMetrics, type TrialStartedEvent, type TrialStatus, type UpcomingInvoice, type UpdateCouponOptions, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type ValidateCouponResult, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
|
|
3120
|
+
export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, AnalyticsClient, type AnalyticsFilterOptions, type AnyWebhookEvent, type AttachPaymentMethodOptions, AuthClient, type BillingPortalSession, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type ChargeResult, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type Coupon, type CouponDiscountType, type CouponDuration, CouponsClient, type CreateCheckoutOptions, type CreateCouponOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type CreateSetupSessionOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerInvoice, type CustomerInvoicesResponse, type CustomerPaymentMethod, type CustomerSubscriptionHistory, type CustomerSubscriptionHistoryResponse, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, type DashboardMetrics, type DunningStatus, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestImage, type FeatureRequestListResponse, FeatureRequestsClient, type FeatureUsagePoint, type GetSubscriptionOptions, type GrowthChartPoint, type GrowthMetrics, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MRRHistoryPoint, type MagicLinkOptions, type MagicLinkResponse, type MigrateToStackbeManagedResult, type Organization, type OrganizationInvite, type OrganizationMember, type OrganizationMembership, OrganizationsClient, type PaymentFailedEvent, type PaymentMethod, PaymentMethodsClient, type PaymentSucceededEvent, type PaymentWebhookPayload, type PerformanceMetrics, type Plan, type PlanMetrics, PlansClient, type PopularEndpoint, type PortalLinkResponse, type Product, ProductsClient, type RequestCountPoint, type RevenueByPlan, type SessionResponse, type SetupSessionResponse, StackBE, type StackBEConfig, StackBEError, type StackBEErrorCode, type StackBEErrorResponse, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionPlan, type SubscriptionRenewedEvent, type SubscriptionUpdatedEvent, type SubscriptionWebhookPayload, type SubscriptionWithPlan, SubscriptionsClient, type SwitchOrganizationResponse, type TimeRangeOptions, type TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialMetrics, type TrialStartedEvent, type TrialStatus, type UpcomingInvoice, type UpdateCouponOptions, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type ValidateCouponResult, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
|
package/dist/index.js
CHANGED
|
@@ -2291,6 +2291,25 @@ var AffiliatesClient = class {
|
|
|
2291
2291
|
async getCommissions() {
|
|
2292
2292
|
return this.http.get("/v1/affiliate/commissions");
|
|
2293
2293
|
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Apply to become a partner. No account required — just an API key.
|
|
2296
|
+
* The application will be reviewed by the app admin.
|
|
2297
|
+
*
|
|
2298
|
+
* @example
|
|
2299
|
+
* ```typescript
|
|
2300
|
+
* const result = await stackbe.affiliates.apply({
|
|
2301
|
+
* email: 'partner@example.com',
|
|
2302
|
+
* name: 'Jane Smith',
|
|
2303
|
+
* company: 'Acme Inc',
|
|
2304
|
+
* website: 'https://acme.com',
|
|
2305
|
+
* reason: 'I have a large audience in the SaaS space',
|
|
2306
|
+
* });
|
|
2307
|
+
* console.log(result.status); // 'pending'
|
|
2308
|
+
* ```
|
|
2309
|
+
*/
|
|
2310
|
+
async apply(options) {
|
|
2311
|
+
return this.http.post("/v1/affiliate/apply", options);
|
|
2312
|
+
}
|
|
2294
2313
|
/**
|
|
2295
2314
|
* Track a referral click (store token for attribution).
|
|
2296
2315
|
* Requires API key.
|
|
@@ -2301,6 +2320,19 @@ var AffiliatesClient = class {
|
|
|
2301
2320
|
referralUrl
|
|
2302
2321
|
});
|
|
2303
2322
|
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Get a link to the hosted partner portal (valid 24 hours).
|
|
2325
|
+
* Requires customer session token and active partner enrollment.
|
|
2326
|
+
*
|
|
2327
|
+
* @example
|
|
2328
|
+
* ```typescript
|
|
2329
|
+
* const { url } = await stackbe.affiliates.getPortalLink();
|
|
2330
|
+
* // Redirect partner to `url` or display in UI
|
|
2331
|
+
* ```
|
|
2332
|
+
*/
|
|
2333
|
+
async getPortalLink() {
|
|
2334
|
+
return this.http.get("/v1/affiliate/portal-link");
|
|
2335
|
+
}
|
|
2304
2336
|
/**
|
|
2305
2337
|
* Get the full partner dashboard with stats, earnings by source, deals, and coupons.
|
|
2306
2338
|
* Requires customer session token.
|
package/dist/index.mjs
CHANGED
|
@@ -2249,6 +2249,25 @@ var AffiliatesClient = class {
|
|
|
2249
2249
|
async getCommissions() {
|
|
2250
2250
|
return this.http.get("/v1/affiliate/commissions");
|
|
2251
2251
|
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Apply to become a partner. No account required — just an API key.
|
|
2254
|
+
* The application will be reviewed by the app admin.
|
|
2255
|
+
*
|
|
2256
|
+
* @example
|
|
2257
|
+
* ```typescript
|
|
2258
|
+
* const result = await stackbe.affiliates.apply({
|
|
2259
|
+
* email: 'partner@example.com',
|
|
2260
|
+
* name: 'Jane Smith',
|
|
2261
|
+
* company: 'Acme Inc',
|
|
2262
|
+
* website: 'https://acme.com',
|
|
2263
|
+
* reason: 'I have a large audience in the SaaS space',
|
|
2264
|
+
* });
|
|
2265
|
+
* console.log(result.status); // 'pending'
|
|
2266
|
+
* ```
|
|
2267
|
+
*/
|
|
2268
|
+
async apply(options) {
|
|
2269
|
+
return this.http.post("/v1/affiliate/apply", options);
|
|
2270
|
+
}
|
|
2252
2271
|
/**
|
|
2253
2272
|
* Track a referral click (store token for attribution).
|
|
2254
2273
|
* Requires API key.
|
|
@@ -2259,6 +2278,19 @@ var AffiliatesClient = class {
|
|
|
2259
2278
|
referralUrl
|
|
2260
2279
|
});
|
|
2261
2280
|
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Get a link to the hosted partner portal (valid 24 hours).
|
|
2283
|
+
* Requires customer session token and active partner enrollment.
|
|
2284
|
+
*
|
|
2285
|
+
* @example
|
|
2286
|
+
* ```typescript
|
|
2287
|
+
* const { url } = await stackbe.affiliates.getPortalLink();
|
|
2288
|
+
* // Redirect partner to `url` or display in UI
|
|
2289
|
+
* ```
|
|
2290
|
+
*/
|
|
2291
|
+
async getPortalLink() {
|
|
2292
|
+
return this.http.get("/v1/affiliate/portal-link");
|
|
2293
|
+
}
|
|
2262
2294
|
/**
|
|
2263
2295
|
* Get the full partner dashboard with stats, earnings by source, deals, and coupons.
|
|
2264
2296
|
* Requires customer session token.
|
package/package.json
CHANGED