Skip to main content

Export TypeScript types from creem_io package

I want the TypeScript types (Checkout, Customer, Product, Subscription, Transaction, License, Discount, WebhookOptions, CheckoutCompletedEvent, SubscriptionEvent, GrantAccessContext, RevokeAccessContext) to be explicitly exported from the 'creem_io' package. Currently, the documentation at https://docs.creem.io/code/sdks/typescript#typescript-support suggests they can be imported, but attempting to do so results in error ts(2459) because they are only declared locally within the module. This makes it difficult to build type-safe applications without using complex workarounds like ReturnType.
Status: Rejected2 comments

Log in to comment and vote

Comments2

  • Micha changed status to Rejected
    Team•

    Aug 3

    Pinned

    The creem_io package is superseded by the creem SDK, which also includes all the TypeScript types https://docs.creem.io/code/sdks/typescript

  • Micha

    •

    Jan 15

    Also:
    The types for SubscriptionEvent and CheckoutCompletedEvent are wrong:

    Current:
    ```
    type SubscriptionEvent<T extends string> = {

        /** Webhook event type identifier */

        webhookEventType: T;

        /** Unique webhook event ID */

        webhookId: string;

        /** Webhook event creation timestamp */

        webhookCreatedAt: number;

    } & NormalizedSubscription;
    ```

    Expected:
    ```
    type SubscriptionEvent<T extends string> = {

        /** Webhook event type identifier */

        eventType: T;

        /** Unique webhook event ID */

        id: string;

        /** Webhook event creation timestamp */

        createdAt: number;

    } & NormalizedSubscription;
    ```

    the same for CheckoutCompletedEvent