@stackbe/sdk 0.8.1 → 0.8.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 CHANGED
@@ -372,14 +372,19 @@ interface CheckoutSessionResponse {
372
372
  /** Expiration time */
373
373
  expiresAt: string;
374
374
  }
375
+ interface SubscriptionPlan {
376
+ id: string;
377
+ name: string;
378
+ priceCents: number;
379
+ currency: string;
380
+ interval: 'month' | 'year';
381
+ }
375
382
  interface SubscriptionWithPlan extends Subscription {
376
- plan: {
377
- id: string;
378
- name: string;
379
- price: number;
380
- interval: 'month' | 'year';
381
- currency: string;
382
- };
383
+ plan: SubscriptionPlan;
384
+ }
385
+ interface GetSubscriptionOptions {
386
+ /** Related objects to expand inline. Supported: plan */
387
+ expand?: ('plan')[];
383
388
  }
384
389
  interface CancelSubscriptionOptions {
385
390
  /** Cancel immediately or at end of billing period */
@@ -899,24 +904,34 @@ declare class SubscriptionsClient {
899
904
  * const subscription = await stackbe.subscriptions.get('cust_123');
900
905
  *
901
906
  * if (subscription) {
902
- * console.log(`Plan: ${subscription.plan.name}`);
903
907
  * console.log(`Status: ${subscription.status}`);
904
908
  * console.log(`Renews: ${subscription.currentPeriodEnd}`);
905
909
  * } else {
906
910
  * console.log('No active subscription');
907
911
  * }
912
+ *
913
+ * // With expanded plan details
914
+ * const sub = await stackbe.subscriptions.get('cust_123', { expand: ['plan'] });
915
+ * if (sub) {
916
+ * console.log(`Plan: ${sub.plan.name}`);
917
+ * console.log(`Price: $${sub.plan.priceCents / 100}/${sub.plan.interval}`);
918
+ * }
908
919
  * ```
909
920
  */
910
- get(customerId: string): Promise<SubscriptionWithPlan | null>;
921
+ get(customerId: string, options?: GetSubscriptionOptions): Promise<SubscriptionWithPlan | null>;
911
922
  /**
912
923
  * Get a subscription by ID.
913
924
  *
914
925
  * @example
915
926
  * ```typescript
916
927
  * const subscription = await stackbe.subscriptions.getById('sub_123');
928
+ *
929
+ * // With expanded plan details
930
+ * const sub = await stackbe.subscriptions.getById('sub_123', { expand: ['plan'] });
931
+ * console.log(`Plan: ${sub.plan.name}`);
917
932
  * ```
918
933
  */
919
- getById(subscriptionId: string): Promise<SubscriptionWithPlan>;
934
+ getById(subscriptionId: string, options?: GetSubscriptionOptions): Promise<SubscriptionWithPlan>;
920
935
  /**
921
936
  * List all subscriptions for a customer.
922
937
  *
@@ -1416,7 +1431,14 @@ declare class ProductsClient {
1416
1431
  interface FeatureRequest {
1417
1432
  id: string;
1418
1433
  title: string;
1434
+ /** @deprecated Use featureDetails instead */
1419
1435
  description?: string;
1436
+ /** What currently happens (the current behavior you want to change) */
1437
+ currentBehavior?: string;
1438
+ /** Detailed description of the requested feature */
1439
+ featureDetails?: string;
1440
+ /** Why this feature is important */
1441
+ whyItMatters?: string;
1420
1442
  status: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
1421
1443
  category?: string;
1422
1444
  authorId: string;
@@ -1435,10 +1457,17 @@ interface FeatureRequestComment {
1435
1457
  }
1436
1458
  interface CreateFeatureRequestOptions {
1437
1459
  title: string;
1438
- description?: string;
1460
+ /** What currently happens (the current behavior you want to change) */
1461
+ currentBehavior?: string;
1462
+ /** Detailed description of the requested feature */
1463
+ featureDetails?: string;
1464
+ /** Why this feature is important */
1465
+ whyItMatters?: string;
1439
1466
  category?: string;
1440
1467
  /** Customer ID for server-side creation with API key */
1441
1468
  customerId?: string;
1469
+ /** @deprecated Use featureDetails instead */
1470
+ description?: string;
1442
1471
  }
1443
1472
  interface ListFeatureRequestsOptions {
1444
1473
  status?: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
@@ -1523,14 +1552,16 @@ declare class FeatureRequestsClient {
1523
1552
  * // With customer session token
1524
1553
  * const request = await stackbe.featureRequests.create({
1525
1554
  * title: 'Dark mode support',
1526
- * description: 'Would love to have a dark theme option',
1555
+ * currentBehavior: 'The app only has a light theme',
1556
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1557
+ * whyItMatters: 'Reduces eye strain when working at night',
1527
1558
  * category: 'UI',
1528
1559
  * });
1529
1560
  *
1530
1561
  * // With API key (server-side)
1531
1562
  * const request = await stackbe.featureRequests.create({
1532
1563
  * title: 'Dark mode support',
1533
- * description: 'Would love to have a dark theme option',
1564
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1534
1565
  * customerId: 'cust_123',
1535
1566
  * });
1536
1567
  * ```
@@ -2042,4 +2073,4 @@ declare class StackBE {
2042
2073
  }): (req: any, res: any, next: any) => Promise<any>;
2043
2074
  }
2044
2075
 
2045
- export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, type AnyWebhookEvent, AuthClient, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type CreateCheckoutOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestListResponse, FeatureRequestsClient, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MagicLinkOptions, type MagicLinkResponse, type Organization, type OrganizationInvite, type OrganizationMember, OrganizationsClient, type PaymentFailedEvent, type PaymentSucceededEvent, type PaymentWebhookPayload, type Plan, PlansClient, type Product, ProductsClient, type SessionResponse, StackBE, type StackBEConfig, StackBEError, type StackBEErrorCode, type StackBEErrorResponse, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionRenewedEvent, type SubscriptionUpdatedEvent, type SubscriptionWebhookPayload, type SubscriptionWithPlan, SubscriptionsClient, type TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialStartedEvent, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
2076
+ export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, type AnyWebhookEvent, AuthClient, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type CreateCheckoutOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestListResponse, FeatureRequestsClient, type GetSubscriptionOptions, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MagicLinkOptions, type MagicLinkResponse, type Organization, type OrganizationInvite, type OrganizationMember, OrganizationsClient, type PaymentFailedEvent, type PaymentSucceededEvent, type PaymentWebhookPayload, type Plan, PlansClient, type Product, ProductsClient, type SessionResponse, 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 TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialStartedEvent, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
package/dist/index.d.ts CHANGED
@@ -372,14 +372,19 @@ interface CheckoutSessionResponse {
372
372
  /** Expiration time */
373
373
  expiresAt: string;
374
374
  }
375
+ interface SubscriptionPlan {
376
+ id: string;
377
+ name: string;
378
+ priceCents: number;
379
+ currency: string;
380
+ interval: 'month' | 'year';
381
+ }
375
382
  interface SubscriptionWithPlan extends Subscription {
376
- plan: {
377
- id: string;
378
- name: string;
379
- price: number;
380
- interval: 'month' | 'year';
381
- currency: string;
382
- };
383
+ plan: SubscriptionPlan;
384
+ }
385
+ interface GetSubscriptionOptions {
386
+ /** Related objects to expand inline. Supported: plan */
387
+ expand?: ('plan')[];
383
388
  }
384
389
  interface CancelSubscriptionOptions {
385
390
  /** Cancel immediately or at end of billing period */
@@ -899,24 +904,34 @@ declare class SubscriptionsClient {
899
904
  * const subscription = await stackbe.subscriptions.get('cust_123');
900
905
  *
901
906
  * if (subscription) {
902
- * console.log(`Plan: ${subscription.plan.name}`);
903
907
  * console.log(`Status: ${subscription.status}`);
904
908
  * console.log(`Renews: ${subscription.currentPeriodEnd}`);
905
909
  * } else {
906
910
  * console.log('No active subscription');
907
911
  * }
912
+ *
913
+ * // With expanded plan details
914
+ * const sub = await stackbe.subscriptions.get('cust_123', { expand: ['plan'] });
915
+ * if (sub) {
916
+ * console.log(`Plan: ${sub.plan.name}`);
917
+ * console.log(`Price: $${sub.plan.priceCents / 100}/${sub.plan.interval}`);
918
+ * }
908
919
  * ```
909
920
  */
910
- get(customerId: string): Promise<SubscriptionWithPlan | null>;
921
+ get(customerId: string, options?: GetSubscriptionOptions): Promise<SubscriptionWithPlan | null>;
911
922
  /**
912
923
  * Get a subscription by ID.
913
924
  *
914
925
  * @example
915
926
  * ```typescript
916
927
  * const subscription = await stackbe.subscriptions.getById('sub_123');
928
+ *
929
+ * // With expanded plan details
930
+ * const sub = await stackbe.subscriptions.getById('sub_123', { expand: ['plan'] });
931
+ * console.log(`Plan: ${sub.plan.name}`);
917
932
  * ```
918
933
  */
919
- getById(subscriptionId: string): Promise<SubscriptionWithPlan>;
934
+ getById(subscriptionId: string, options?: GetSubscriptionOptions): Promise<SubscriptionWithPlan>;
920
935
  /**
921
936
  * List all subscriptions for a customer.
922
937
  *
@@ -1416,7 +1431,14 @@ declare class ProductsClient {
1416
1431
  interface FeatureRequest {
1417
1432
  id: string;
1418
1433
  title: string;
1434
+ /** @deprecated Use featureDetails instead */
1419
1435
  description?: string;
1436
+ /** What currently happens (the current behavior you want to change) */
1437
+ currentBehavior?: string;
1438
+ /** Detailed description of the requested feature */
1439
+ featureDetails?: string;
1440
+ /** Why this feature is important */
1441
+ whyItMatters?: string;
1420
1442
  status: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
1421
1443
  category?: string;
1422
1444
  authorId: string;
@@ -1435,10 +1457,17 @@ interface FeatureRequestComment {
1435
1457
  }
1436
1458
  interface CreateFeatureRequestOptions {
1437
1459
  title: string;
1438
- description?: string;
1460
+ /** What currently happens (the current behavior you want to change) */
1461
+ currentBehavior?: string;
1462
+ /** Detailed description of the requested feature */
1463
+ featureDetails?: string;
1464
+ /** Why this feature is important */
1465
+ whyItMatters?: string;
1439
1466
  category?: string;
1440
1467
  /** Customer ID for server-side creation with API key */
1441
1468
  customerId?: string;
1469
+ /** @deprecated Use featureDetails instead */
1470
+ description?: string;
1442
1471
  }
1443
1472
  interface ListFeatureRequestsOptions {
1444
1473
  status?: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
@@ -1523,14 +1552,16 @@ declare class FeatureRequestsClient {
1523
1552
  * // With customer session token
1524
1553
  * const request = await stackbe.featureRequests.create({
1525
1554
  * title: 'Dark mode support',
1526
- * description: 'Would love to have a dark theme option',
1555
+ * currentBehavior: 'The app only has a light theme',
1556
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1557
+ * whyItMatters: 'Reduces eye strain when working at night',
1527
1558
  * category: 'UI',
1528
1559
  * });
1529
1560
  *
1530
1561
  * // With API key (server-side)
1531
1562
  * const request = await stackbe.featureRequests.create({
1532
1563
  * title: 'Dark mode support',
1533
- * description: 'Would love to have a dark theme option',
1564
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1534
1565
  * customerId: 'cust_123',
1535
1566
  * });
1536
1567
  * ```
@@ -2042,4 +2073,4 @@ declare class StackBE {
2042
2073
  }): (req: any, res: any, next: any) => Promise<any>;
2043
2074
  }
2044
2075
 
2045
- export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, type AnyWebhookEvent, AuthClient, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type CreateCheckoutOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestListResponse, FeatureRequestsClient, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MagicLinkOptions, type MagicLinkResponse, type Organization, type OrganizationInvite, type OrganizationMember, OrganizationsClient, type PaymentFailedEvent, type PaymentSucceededEvent, type PaymentWebhookPayload, type Plan, PlansClient, type Product, ProductsClient, type SessionResponse, StackBE, type StackBEConfig, StackBEError, type StackBEErrorCode, type StackBEErrorResponse, type Subscription, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, type SubscriptionRenewedEvent, type SubscriptionUpdatedEvent, type SubscriptionWebhookPayload, type SubscriptionWithPlan, SubscriptionsClient, type TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialStartedEvent, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
2076
+ export { type AddMemberOptions, type AffiliateCommission, type AffiliateCommissionsResponse, type AffiliateEnrollment, type AffiliateInfo, type AffiliateStats, AffiliatesClient, type AnyWebhookEvent, AuthClient, type CancelSubscriptionOptions, type CancelSubscriptionResponse, type CheckEntitlementResponse, type CheckUsageResponse, CheckoutClient, type CheckoutSessionResponse, type CreateCheckoutOptions, type CreateCustomerOptions, type CreateEarlyAccessSignupOptions, type CreateFeatureRequestOptions, type CreateOrganizationOptions, type Customer, type CustomerCreatedEvent, type CustomerFeatureActivity, type CustomerUpdatedEvent, type CustomerUsageResponse, type CustomerWebhookPayload, type CustomerWithSubscription, CustomersClient, EarlyAccessClient, type EarlyAccessSignup, type EarlyAccessSignupListResponse, type EnrollOptions, EntitlementsClient, type EntitlementsResponse, type FeatureRequest, type FeatureRequestComment, type FeatureRequestListResponse, FeatureRequestsClient, type GetSubscriptionOptions, type InterestedCustomer, type InterestedCustomersResponse, type InviteMemberOptions, type ListEarlyAccessOptions, type ListFeatureRequestsOptions, type ListPlansOptions, type ListProductsOptions, type MagicLinkOptions, type MagicLinkResponse, type Organization, type OrganizationInvite, type OrganizationMember, OrganizationsClient, type PaymentFailedEvent, type PaymentSucceededEvent, type PaymentWebhookPayload, type Plan, PlansClient, type Product, ProductsClient, type SessionResponse, 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 TrackReferralResponse, type TrackUsageOptions, type TrackUsageResponse, type TrialEndedEvent, type TrialStartedEvent, type UpdateCustomerOptions, type UpdateOrganizationOptions, type UpdateSubscriptionOptions, UsageClient, type UsageMetric, type VerifyTokenResponse, type WebhookEvent, type WebhookEventType };
package/dist/index.js CHANGED
@@ -738,19 +738,29 @@ var SubscriptionsClient = class {
738
738
  * const subscription = await stackbe.subscriptions.get('cust_123');
739
739
  *
740
740
  * if (subscription) {
741
- * console.log(`Plan: ${subscription.plan.name}`);
742
741
  * console.log(`Status: ${subscription.status}`);
743
742
  * console.log(`Renews: ${subscription.currentPeriodEnd}`);
744
743
  * } else {
745
744
  * console.log('No active subscription');
746
745
  * }
746
+ *
747
+ * // With expanded plan details
748
+ * const sub = await stackbe.subscriptions.get('cust_123', { expand: ['plan'] });
749
+ * if (sub) {
750
+ * console.log(`Plan: ${sub.plan.name}`);
751
+ * console.log(`Price: $${sub.plan.priceCents / 100}/${sub.plan.interval}`);
752
+ * }
747
753
  * ```
748
754
  */
749
- async get(customerId) {
755
+ async get(customerId, options) {
750
756
  try {
757
+ const params = { customerId };
758
+ if (options?.expand?.length) {
759
+ params.expand = options.expand.join(",");
760
+ }
751
761
  return await this.http.get(
752
762
  `/v1/subscriptions/current`,
753
- { customerId }
763
+ params
754
764
  );
755
765
  } catch (error) {
756
766
  if (error instanceof Error && "statusCode" in error && error.statusCode === 404) {
@@ -765,10 +775,18 @@ var SubscriptionsClient = class {
765
775
  * @example
766
776
  * ```typescript
767
777
  * const subscription = await stackbe.subscriptions.getById('sub_123');
778
+ *
779
+ * // With expanded plan details
780
+ * const sub = await stackbe.subscriptions.getById('sub_123', { expand: ['plan'] });
781
+ * console.log(`Plan: ${sub.plan.name}`);
768
782
  * ```
769
783
  */
770
- async getById(subscriptionId) {
771
- return this.http.get(`/v1/subscriptions/${subscriptionId}`);
784
+ async getById(subscriptionId, options) {
785
+ const params = {};
786
+ if (options?.expand?.length) {
787
+ params.expand = options.expand.join(",");
788
+ }
789
+ return this.http.get(`/v1/subscriptions/${subscriptionId}`, params);
772
790
  }
773
791
  /**
774
792
  * List all subscriptions for a customer.
@@ -1541,14 +1559,16 @@ var FeatureRequestsClient = class {
1541
1559
  * // With customer session token
1542
1560
  * const request = await stackbe.featureRequests.create({
1543
1561
  * title: 'Dark mode support',
1544
- * description: 'Would love to have a dark theme option',
1562
+ * currentBehavior: 'The app only has a light theme',
1563
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1564
+ * whyItMatters: 'Reduces eye strain when working at night',
1545
1565
  * category: 'UI',
1546
1566
  * });
1547
1567
  *
1548
1568
  * // With API key (server-side)
1549
1569
  * const request = await stackbe.featureRequests.create({
1550
1570
  * title: 'Dark mode support',
1551
- * description: 'Would love to have a dark theme option',
1571
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1552
1572
  * customerId: 'cust_123',
1553
1573
  * });
1554
1574
  * ```
package/dist/index.mjs CHANGED
@@ -699,19 +699,29 @@ var SubscriptionsClient = class {
699
699
  * const subscription = await stackbe.subscriptions.get('cust_123');
700
700
  *
701
701
  * if (subscription) {
702
- * console.log(`Plan: ${subscription.plan.name}`);
703
702
  * console.log(`Status: ${subscription.status}`);
704
703
  * console.log(`Renews: ${subscription.currentPeriodEnd}`);
705
704
  * } else {
706
705
  * console.log('No active subscription');
707
706
  * }
707
+ *
708
+ * // With expanded plan details
709
+ * const sub = await stackbe.subscriptions.get('cust_123', { expand: ['plan'] });
710
+ * if (sub) {
711
+ * console.log(`Plan: ${sub.plan.name}`);
712
+ * console.log(`Price: $${sub.plan.priceCents / 100}/${sub.plan.interval}`);
713
+ * }
708
714
  * ```
709
715
  */
710
- async get(customerId) {
716
+ async get(customerId, options) {
711
717
  try {
718
+ const params = { customerId };
719
+ if (options?.expand?.length) {
720
+ params.expand = options.expand.join(",");
721
+ }
712
722
  return await this.http.get(
713
723
  `/v1/subscriptions/current`,
714
- { customerId }
724
+ params
715
725
  );
716
726
  } catch (error) {
717
727
  if (error instanceof Error && "statusCode" in error && error.statusCode === 404) {
@@ -726,10 +736,18 @@ var SubscriptionsClient = class {
726
736
  * @example
727
737
  * ```typescript
728
738
  * const subscription = await stackbe.subscriptions.getById('sub_123');
739
+ *
740
+ * // With expanded plan details
741
+ * const sub = await stackbe.subscriptions.getById('sub_123', { expand: ['plan'] });
742
+ * console.log(`Plan: ${sub.plan.name}`);
729
743
  * ```
730
744
  */
731
- async getById(subscriptionId) {
732
- return this.http.get(`/v1/subscriptions/${subscriptionId}`);
745
+ async getById(subscriptionId, options) {
746
+ const params = {};
747
+ if (options?.expand?.length) {
748
+ params.expand = options.expand.join(",");
749
+ }
750
+ return this.http.get(`/v1/subscriptions/${subscriptionId}`, params);
733
751
  }
734
752
  /**
735
753
  * List all subscriptions for a customer.
@@ -1502,14 +1520,16 @@ var FeatureRequestsClient = class {
1502
1520
  * // With customer session token
1503
1521
  * const request = await stackbe.featureRequests.create({
1504
1522
  * title: 'Dark mode support',
1505
- * description: 'Would love to have a dark theme option',
1523
+ * currentBehavior: 'The app only has a light theme',
1524
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1525
+ * whyItMatters: 'Reduces eye strain when working at night',
1506
1526
  * category: 'UI',
1507
1527
  * });
1508
1528
  *
1509
1529
  * // With API key (server-side)
1510
1530
  * const request = await stackbe.featureRequests.create({
1511
1531
  * title: 'Dark mode support',
1512
- * description: 'Would love to have a dark theme option',
1532
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1513
1533
  * customerId: 'cust_123',
1514
1534
  * });
1515
1535
  * ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbe/sdk",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Official JavaScript/TypeScript SDK for StackBE - the billing backend for your side project",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",