Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The SDK provides access to Base44's functionality through the following modules:
- **[`entities`](https://docs.base44.com/developers/references/sdk/docs/interfaces/entities)**: Work with your app's data entities using CRUD operations.
- **[`functions`](https://docs.base44.com/developers/references/sdk/docs/interfaces/functions)**: Execute backend functions.
- **[`integrations`](https://docs.base44.com/developers/references/sdk/docs/type-aliases/integrations)**: Access pre-built and third-party integrations.
- **[`payments`](https://docs.base44.com/developers/references/sdk/docs/interfaces/payments)**: Embed checkouts, look up purchases, and handle refunds and subscriptions with the service role.

## Quickstarts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@
"interfaces/ActorClient",
"interfaces/ActorRegistry",
"interfaces/ActorNameRegistry"
],
"interfaces/PaymentsModule": [
"type-aliases/PaymentsErrorCode",
"type-aliases/PurchaseStatus",
"type-aliases/PaymentsRecurringFrequency"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
"FunctionsModule",
"ImportResult",
"IntegrationsModule",
"PaymentsErrorCode",
"PaymentsModule",
"PaymentsRecurringFrequency",
"PurchaseStatus",
"ServiceRolePaymentsModule",
"SortField",
"SsoModule",
"UpdateManyResult"
Expand Down
6 changes: 6 additions & 0 deletions packages/sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import type {
CreateClientOptions,
} from "./client.types.js";
import { createAnalyticsModule } from "./modules/analytics.js";
import {
createPaymentsModule,
createServiceRolePaymentsModule,
} from "./modules/payments.js";
import {
createActorsModule,
resolveActorsHost,
Expand Down Expand Up @@ -263,6 +267,7 @@ export function createClient(config: CreateClientConfig): Base44Client {
appLogs: createAppLogsModule(axiosClient, appId),
app: createAppModule(axiosClient, appId),
users: createUsersModule(axiosClient, appId),
payments: createPaymentsModule(axiosClient, appId),
analytics: createAnalyticsModule({
axiosClient,
serverUrl,
Expand Down Expand Up @@ -314,6 +319,7 @@ export function createClient(config: CreateClientConfig): Base44Client {
headers: aiGatewayHeaders,
}),
appLogs: createAppLogsModule(serviceRoleAxiosClient, appId),
payments: createServiceRolePaymentsModule(serviceRoleAxiosClient, appId),
cleanup: () => {
if (socket) {
socket.disconnect();
Expand Down
8 changes: 8 additions & 0 deletions packages/sdk/src/client.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import type { EntitiesModule } from "./modules/entities.types.js";
import type { IntegrationsModule } from "./modules/integrations.types.js";
import type { AuthModule } from "./modules/auth.types.js";
import type { SsoModule } from "./modules/sso.types.js";
import type {
PaymentsModule,
ServiceRolePaymentsModule,
} from "./modules/payments.types.js";
import type {
ConnectorsModule,
UserConnectorsModule,
Expand Down Expand Up @@ -145,6 +149,8 @@ export interface Base44Client {
functions: FunctionsModule;
/** {@link IntegrationsModule | Integrations module} for calling pre-built integration endpoints. */
integrations: IntegrationsModule;
/** {@link PaymentsModule | Payments module} for checkouts and purchases. */
payments: PaymentsModule;
/** Cleanup function to disconnect WebSocket connections. Call when you're done with the client. */
cleanup: () => void;

Expand Down Expand Up @@ -241,6 +247,8 @@ export interface Base44Client {
functions: FunctionsModule;
/** {@link IntegrationsModule | Integrations module} with elevated permissions. */
integrations: IntegrationsModule;
/** {@link ServiceRolePaymentsModule | Payments module} for creating checkouts, refunds, and subscription changes. */
payments: ServiceRolePaymentsModule;
/** {@link SsoModule | SSO module} for generating SSO tokens. */
sso: SsoModule;
/** Cleanup function to disconnect WebSocket connections. */
Expand Down
32 changes: 32 additions & 0 deletions packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,38 @@ export type {

export type { SsoModule, SsoAccessTokenResponse } from "./modules/sso.types.js";

export type {
PaymentsModule,
ServiceRolePaymentsModule,
PaymentsErrorCode,
PaymentsRecurringFrequency,
CheckoutBuyer,
CheckoutFreeTrial,
CheckoutItem,
CheckoutItemRecurring,
CheckoutPresentation,
CheckoutElement,
CheckoutMount,
MountableCheckout,
CreateCheckoutParams,
CreateCheckoutResult,
CompleteCheckoutResult,
EmbeddedCheckout,
PayPalEmbeddedCheckout,
StripeEmbeddedCheckout,
MountCheckoutOptions,
ListPurchasesParams,
ServiceRoleListPurchasesParams,
ListPurchasesResult,
Purchase,
PurchaseItem,
PurchaseStatus,
RefundParams,
RefundResult,
CancelSubscriptionOptions,
SubscriptionResult,
} from "./modules/payments.types.js";

export { Actor, type Conn } from "./actor.js";

export type {
Expand Down
Loading
Loading