@paykit-sdk/stripe 1.0.0 → 1.0.1

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
@@ -33,6 +33,7 @@ declare class StripeProvider implements PayKitProvider {
33
33
  handleWebhook: (payload: string, signature: string, secret: string) => Promise<WebhookEventPayload>;
34
34
  }
35
35
 
36
+ declare const createStripe: (config: StripeConfig) => StripeProvider;
36
37
  declare const stripe: () => StripeProvider;
37
38
 
38
- export { stripe };
39
+ export { createStripe, stripe };
package/dist/index.d.ts CHANGED
@@ -33,6 +33,7 @@ declare class StripeProvider implements PayKitProvider {
33
33
  handleWebhook: (payload: string, signature: string, secret: string) => Promise<WebhookEventPayload>;
34
34
  }
35
35
 
36
+ declare const createStripe: (config: StripeConfig) => StripeProvider;
36
37
  declare const stripe: () => StripeProvider;
37
38
 
38
- export { stripe };
39
+ export { createStripe, stripe };
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ createStripe: () => createStripe,
33
34
  stripe: () => stripe
34
35
  });
35
36
  module.exports = __toCommonJS(index_exports);
@@ -156,12 +157,14 @@ var createStripe = (config) => {
156
157
  };
157
158
  var stripe = () => {
158
159
  const apiKey = process.env.STRIPE_API_KEY;
160
+ const isDev = process.env.NODE_ENV === "development";
159
161
  if (!apiKey) {
160
162
  throw new Error("STRIPE_API_KEY is not set");
161
163
  }
162
- return createStripe({ apiKey, apiVersion: "2025-05-28.basil" });
164
+ return createStripe({ apiKey, apiVersion: "2025-05-28.basil", environment: isDev ? "test" : "live" });
163
165
  };
164
166
  // Annotate the CommonJS export names for ESM import in node:
165
167
  0 && (module.exports = {
168
+ createStripe,
166
169
  stripe
167
170
  });
package/dist/index.mjs CHANGED
@@ -122,11 +122,13 @@ var createStripe = (config) => {
122
122
  };
123
123
  var stripe = () => {
124
124
  const apiKey = process.env.STRIPE_API_KEY;
125
+ const isDev = process.env.NODE_ENV === "development";
125
126
  if (!apiKey) {
126
127
  throw new Error("STRIPE_API_KEY is not set");
127
128
  }
128
- return createStripe({ apiKey, apiVersion: "2025-05-28.basil" });
129
+ return createStripe({ apiKey, apiVersion: "2025-05-28.basil", environment: isDev ? "test" : "live" });
129
130
  };
130
131
  export {
132
+ createStripe,
131
133
  stripe
132
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paykit-sdk/stripe",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Stripe provider for PayKit",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",