@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
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type WebhookHandlerConfig } from "@dodopayments/core/webhook";
|
|
2
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
3
|
+
export declare const Webhooks: ({ webhookKey, ...eventHandlers }: WebhookHandlerConfig) => (req: NextRequest) => Promise<NextResponse<unknown>>;
|
|
4
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/webhooks/webhooks.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIxD,eAAO,MAAM,QAAQ,GAAI,kCAGtB,oBAAoB,MAGP,KAAK,WAAW,mCAkD/B,CAAC"}
|
package/llm-prompt.txt
CHANGED
|
@@ -92,7 +92,7 @@ Here's how you should structure your response:
|
|
|
92
92
|
import { Webhooks } from '@dodopayments/nextjs'
|
|
93
93
|
|
|
94
94
|
export const POST = Webhooks({
|
|
95
|
-
webhookKey: process.env.
|
|
95
|
+
webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_SECRET!,
|
|
96
96
|
onPayload: async (payload) => {
|
|
97
97
|
// handle the payload
|
|
98
98
|
},
|
|
@@ -141,18 +141,18 @@ Here's how you should structure your response:
|
|
|
141
141
|
|
|
142
142
|
* `DODO_PAYMENTS_API_KEY`: Your Dodo Payments API Key (required for Checkout and Customer Portal).
|
|
143
143
|
* `RETURN_URL`: (Optional) The URL to redirect to after a successful checkout (for Checkout handler).
|
|
144
|
-
* `
|
|
144
|
+
* `DODO_PAYMENTS_WEBHOOK_SECRET`: Your Dodo Payments Webhook Secret (required for Webhook handler).
|
|
145
145
|
|
|
146
146
|
**Example `.env` file:**
|
|
147
147
|
```env
|
|
148
148
|
DODO_PAYMENTS_API_KEY=your-api-key
|
|
149
|
-
|
|
149
|
+
DODO_PAYMENTS_WEBHOOK_SECRET=your-webhook-secret
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
**Usage in your code:**
|
|
153
153
|
```typescript
|
|
154
154
|
bearerToken: process.env.DODO_PAYMENTS_API_KEY!
|
|
155
|
-
webhookKey: process.env.
|
|
155
|
+
webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_SECRET!
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
**Important:** Never commit sensitive environment variables directly into your version control. Use environment variables for all sensitive information.
|
package/package.json
CHANGED