@dodopayments/nextjs 0.1.5 → 0.1.7
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/README.md +5 -5
- package/dist/checkout/checkout.d.ts +4 -0
- package/dist/checkout/checkout.d.ts.map +1 -0
- package/dist/customer-portal/customer-portal.d.ts +5 -0
- package/dist/customer-portal/customer-portal.d.ts.map +1 -0
- package/dist/index.cjs +8977 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8973 -0
- package/dist/index.js.map +1 -0
- package/dist/webhooks/webhooks.d.ts +4 -0
- package/dist/webhooks/webhooks.d.ts.map +1 -0
- package/llm-prompt.txt +4 -4
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ Returns 400 if `customer_id` is missing.
|
|
|
64
64
|
import { Webhooks } from "@dodopayments/nextjs";
|
|
65
65
|
|
|
66
66
|
export const POST = Webhooks({
|
|
67
|
-
webhookKey: process.env.
|
|
67
|
+
webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_SECRET!,
|
|
68
68
|
onPayload: async (payload) => {
|
|
69
69
|
// handle the payload
|
|
70
70
|
},
|
|
@@ -192,7 +192,7 @@ Code Snippet:
|
|
|
192
192
|
import { Webhooks } from '@dodopayments/nextjs'
|
|
193
193
|
|
|
194
194
|
export const POST = Webhooks({
|
|
195
|
-
webhookKey: process.env.
|
|
195
|
+
webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_SECRET!,
|
|
196
196
|
onPayload: async (payload) => {
|
|
197
197
|
// handle the payload
|
|
198
198
|
},
|
|
@@ -273,17 +273,17 @@ To ensure the adapter functions correctly, you will need to manually set up the
|
|
|
273
273
|
|
|
274
274
|
RETURN_URL: (Optional) The URL to redirect to after a successful checkout (for Checkout handler).
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
DODO_PAYMENTS_WEBHOOK_SECRET: Your Dodo Payments Webhook Secret (required for Webhook handler).
|
|
277
277
|
|
|
278
278
|
Example .env file:
|
|
279
279
|
|
|
280
280
|
DODO_PAYMENTS_API_KEY=your-api-key
|
|
281
|
-
|
|
281
|
+
DODO_PAYMENTS_WEBHOOK_SECRET=your-webhook-secret
|
|
282
282
|
|
|
283
283
|
Usage in your code:
|
|
284
284
|
|
|
285
285
|
bearerToken: process.env.DODO_PAYMENTS_API_KEY!
|
|
286
|
-
webhookKey: process.env.
|
|
286
|
+
webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_SECRET!
|
|
287
287
|
|
|
288
288
|
Important: Never commit sensitive environment variables directly into your version control. Use environment variables for all sensitive information.
|
|
289
289
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
+
import { CheckoutHandlerConfig } from "@dodopayments/core/checkout";
|
|
3
|
+
export declare const Checkout: (config: CheckoutHandlerConfig) => (req: NextRequest) => Promise<NextResponse<unknown>>;
|
|
4
|
+
//# sourceMappingURL=checkout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/checkout/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAEL,qBAAqB,EAGtB,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,QAAQ,GAAI,QAAQ,qBAAqB,MA4D5C,KAAK,WAAW,mCAMzB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
+
import { ClientOptions } from "dodopayments";
|
|
3
|
+
export type CustomerPortalConfig = Pick<ClientOptions, "environment" | "bearerToken">;
|
|
4
|
+
export declare const CustomerPortal: ({ bearerToken, environment, }: CustomerPortalConfig) => (req: NextRequest) => Promise<NextResponse<unknown>>;
|
|
5
|
+
//# sourceMappingURL=customer-portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer-portal.d.ts","sourceRoot":"","sources":["../../src/customer-portal/customer-portal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD,OAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,aAAa,EACb,aAAa,GAAG,aAAa,CAC9B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,+BAG5B,oBAAoB,WACU,WAAW,mCAwC3C,CAAC"}
|